This question is locked. New answers and comments are not allowed.
Hi,
Im using version 2010.1.309.1030 and I need to reverse the legend item order in a stacked bar chart. as I'm on an older version I don;t have access to the ReverseLegendItemsOrder property, so I'm attempting to do the following:
Chart.DataBound += new EventHandler<ChartDataBoundEventArgs>(Chart_DataBound);
void Chart_DataBound(object sender, ChartDataBoundEventArgs e)
{
var items = new List<ChartLegendItem>(Chart.DefaultView.ChartLegend.ItemsSource.Cast<ChartLegendItem>());
items.Reverse();
Chart.DefaultView.ChartLegend.ItemsSource = items;
}
However this seems to override the automatic crreation of the legend items, so when I rebind the chart with different data (and a different legend) the legend remains the previous one.
Thanks