I am using Composite Chart to Plot 3 line series.i used different iconSize and Diff LineDrawStyle to differentiate these 3 lines.But in the legend all are same ie the icon symbol is not shown.any one help me solve this issue?
I have the same issue but I want to keep the lines and add the symbols, not just replace the lines. Iam using VB, Can you please help?
Thanks to you .My problem solved
updated sample project
this is a bit more complicated but here you go:
protected void UltraChart1_FillSceneGraph(object sender, FillSceneGraphEventArgs e) { PrimitiveCollection primitivesToAdd = new PrimitiveCollection(); PrimitiveCollection primitivesToRemove = new PrimitiveCollection(); ChartLayerCollection layers = this.UltraChart1.CompositeChart.Legends[0].ChartLayers; int currentLayerIndex = 0; ChartLayerAppearance currentLayer = layers[currentLayerIndex]; LineChartAppearance lineApp = currentLayer.ChartTypeAppearance as LineChartAppearance; int seriesCounter = 0; foreach (Primitive p in e.SceneGraph) { if (p.Path != null && p.Path.IndexOf("Legend") != -1) { Polyline pL = p as Polyline; if (pL != null) { // we found a polyline in the legend. let's replace it. Symbol sym = new Symbol(); // get the centerpoint of the polyline sym.point = new Point((pL.points[0].point.X + pL.points[pL.points.Length - 1].point.X) / 2, (pL.points[0].point.Y + pL.points[pL.points.Length - 1].point.Y) / 2); // get the correct icon sym.icon = lineApp.LineAppearances[pL.Row].IconAppearance.Icon; sym.PE = pL.PE; primitivesToAdd.Add(sym); primitivesToRemove.Add(pL); seriesCounter++; if (seriesCounter >= currentLayer.Series.Count && layers.Count > currentLayerIndex + 1) { currentLayerIndex++; currentLayer = layers[currentLayerIndex]; lineApp = currentLayer.ChartTypeAppearance as LineChartAppearance; seriesCounter = 0; } } } } foreach (Primitive p in primitivesToRemove) { e.SceneGraph.Remove(p); } e.SceneGraph.AddRange(primitivesToAdd.ToArray()); }
i used 3 layers but in legend i can see only one Symbol ie Ist Layer Symbol for all Layers.Can u help me