Hi
I am using spline chart, line chart(Composite chart - merged with bars). In this I am having issue of displaying datapoint. All other points except start point, end point are dotted circle in black color. This two points having value but it display differently. It should display as like others. I attached the screenshot. I need solution for spline chart as well as composite chart.
Thanks
Sridhar
Those black circles are MidPointAnchors. They cannot appear at the start or the end of the spline. This is done by design to indicate MidPoints of the spline. You can turn off those anchors by setting MidPointAnchors property of the spline chart to false. If you need to have black circles on both ends of the spline this would have to be custom drawn in FillSceneGraph event.
ok. I have to show this start and end points. Can you guide how can I set thse points?
Handle FillSceneGraph eventLoop through the primitivesCapture Polyline primitivesCreate two Symbol primitives for each polyline - one for start, one for endAdd symbols to the scenegraph
void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ PrimitiveCollection symbolicons = new PrimitiveCollection();
foreach (Primitive p in e.SceneGraph) { Polyline poly = p as Polyline; if (poly != null) { Symbol s = new Symbol(); s.icon = SymbolIcon.Circle; s.iconSize= SymbolIconSize.Medium; s.PE.Fill = Color.Black; s.point = poly.points[0].point; symbolicons.Add(s); } }}
Try the following code to get the text labels to appear along the line. You don't need to handle FillSceneGraph, but that could have been a good alternate approach.
DataTable dt = new DataTable();dt.Columns.Add("col1", typeof(string));dt.Columns.Add("col2", typeof(int));dt.Columns.Add("col3", typeof(int));dt.Rows.Add(new object[] { "point 1", 4, 10 });dt.Rows.Add(new object[] { "point 2", 5, 16 });dt.Rows.Add(new object[] { "point 3", 1, 17 });dt.Rows.Add(new object[] { "point 4", 3, 13 });dt.Rows.Add(new object[] { "point 5", 5, 17 });
ultraChart1.ChartType = ChartType.ColumnLineChart;ultraChart1.ColumnLineChart.ColumnData.DataSource = dt;ultraChart1.ColumnLineChart.ColumnData.IncludeColumn(2, false);ultraChart1.ColumnLineChart.ColumnData.RowLabelsColumn = 0;
ultraChart1.ColumnLineChart.LineData.DataSource = dt;ultraChart1.ColumnLineChart.LineData.SwapRowsAndColumns = true;ultraChart1.ColumnLineChart.LineData.IncludeColumn(1, false);
ultraChart1.Data.DataBind();
ChartTextAppearance chartText = new ChartTextAppearance();chartText.Row = chartText.Column = -2;chartText.Visible = true;chartText.ItemFormatString = "<DATA_VALUE>";ultraChart1.ColumnLineChart.Line.ChartText.Add(chartText);
Hello
I am facing this problem with a columnline chart.
I want the values that are ussed to make the line, to appear along the line.
For this, I have overrided FillSceneGraph and as I saw in older posts, i have tried to get the primitives that are polyline. But there are no polyline primitives, only line primitives on my stage.
The lines primitives have just the initial point and the final one, but in this case too, I wasn't able to get its exact location.
I did something like this:
ArrayList allBoxes = new ArrayList();
Line line; foreach (Primitive p in scene) { line = p as Line; if (line != null) { allBoxes.Add(p); } } line = (Line)allBoxes[1]; style.FontColor = line.drawColor; text = new Text( line.p1 , mData.Rows[0]["CONSO"].ToString(), style ); scene.Add( text);
but line.p1 dowsn't give me what I want. the x is correct, but the Y is allways the origin of the axes.
Could you please help me with this :((( thank you in advance
Looks like the clip bounds rectangle has been reset. Try adding this code before you add the point icons:
GraphicsContext gc = new GraphicsContext();gc.SetClipBounds(e.ChartCore.GridLayerBounds);e.SceneGraph.Add(gc);
ya. Great. It works. Tha But other points is just behind the axis line and this one come in front of the axis line. Looks different than other points. Pls refer the screenshot. Is there any solution for this?
Sorry, looks like some of the code got cut out of my code snippet. You have created the symbols, but they were never added to the scenegraph after the first foreach loop.
foreach (Symbol icon in symbolicons){ e.SceneGraph.Add(icon);}