views:

43

answers:

0

I've got a chart with 8 series - call them S1 through S8. They're in order in the chart's list of series, and they're presented using custom legend items (Legend.CustomItems). Everything works fine, except there seems to be a bug with how items are displayed in the legend when the legend wraps around to a new line.

I'd like the items to be displayed in rows:

S1 S2 S3 S4
S5 S6 S7 S8

Unfortunately, it seems like when the legend detects that it's going to take two rows, it fills in vertically before horizontally, like so:

S1 S3 S5 S7
S2 S4 S6 S8

Is there any way to get the items arranged properly? Is this a bug with the controls?

var chart = new Chart();
// More chart setup
foreach(var s in chart.Series)
{
    if (simpleLegend) chart.Legends[0].CustomItems.Add(s.Color, s.LegendText);
    else
    {
        var legendItem = new LegendItem();
        // Legend item customization
        chart.Legends[0].CustomItems.Add(legendItem);
    }
}