Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
520
Pie Chart Composite Legend
posted

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);