I'm trying to change the order of legends (series type legend) in code behind. I have already tried to use the LegendItemOrder property as shown here. But this didn't work out for me.
I also tried to add a custom legend event through code behind as shown here. The custom legend event is added using the below code. But not sure on what arguments to pass with CustomizeLegendEventHandler(arg1, arg2) since the definition has two arguments?
chart.CustomizeLegend += new EventHandler<CustomizeLegendEventArgs> (CustomizeLegendEventHandler);
The event handler definition is shown below.
private void CustomizeLegendEventHandler(object sender, CustomizeLegendEventArgs e)
{
if (e != null)
{
}
}
Please let know what arguments should be passed to CustomizeLegendEventHandler and how to re-order the legend text?