I currently have a pie chart configured with a composite legend on and set to the layer that the pie chart series is setup on.
I have a problem when the others percent property is set to anything other than 0, including the default value. What happens is the legend draws with every item from the series labelcolumn. So even though visually the chart's grouping a few items into the others slice, it still shows up in the legend.
How can I fix this?
My composite legend setup code:
CompositeLegend legend = new CompositeLegend(m_chart.CompositeChart.ChartComponent);legend.BoundsMeasureType = MeasureType.Percentage;legend.LabelStyle.FontSizeBestFit = true;legend.LabelStyle.ClipText = true;legend.ChartLayers.Add(layer);m_chart.CompositeChart.Legends.Add(legend);
This is what I get using 10.2.2058 and the following code:ultraChart1.ChartType = ChartType.Composite;ChartArea area = new ChartArea();ultraChart1.CompositeChart.ChartAreas.Add(area);
NumericSeries series = new NumericSeries();series.Points.Add(new NumericDataPoint(1, "one", false));series.Points.Add(new NumericDataPoint(2, "two", false));series.Points.Add(new NumericDataPoint(3, "three", false));series.Points.Add(new NumericDataPoint(4, "four", false));series.Points.Add(new NumericDataPoint(99, "five", false));ultraChart1.CompositeChart.Series.Add(series);
ChartLayerAppearance layer = new ChartLayerAppearance();layer.ChartType = ChartType.PieChart;layer.ChartArea = area;layer.Series.Add(series);ultraChart1.CompositeChart.ChartLayers.Add(layer);
CompositeLegend legend = new CompositeLegend();legend.Bounds = new Rectangle(0, 0, 100, 100);legend.ChartLayers.Add(layer);ultraChart1.CompositeChart.Legends.Add(legend);
As you can see from the image, Others appears in the legend:
10.2.20102.2058
I was using 10.3 build 2064.What is the buld number you're using for 10.2?
What version did you try it in?
I'm using 10.2.
Looks like this issue has been addressed. When I create a composite pie chart with a composite legend, I do see the "Others" entry in the legend. Please make sure you're using the latest version of NetAdvantage.