Aatish Molasi
Aatish Molasi

Reputation: 2186

HIghcharts seperation of legend and pie

I am developing an application and i need the data in the pie to be displayed in an ascending order The chart has a legend ..

heres the fiddle

What i need is the data in the pie should be shown from smallest to greatest whereas the legend should maintain its state ..

100-200 ..
200-300 ..
..and so on ..

Is that possible without having to seperately create the legend ..

Upvotes: 0

Views: 1267

Answers (1)

j0nes
j0nes

Reputation: 8099

When passing the series, you can also give complete objects instead of datapoints and labels only. These objects also have a legendIndex property where you can specify the exact position in the legend.

Now when you give the series, you have to manually sort it by the value ascending. This will arrange the pie chart in ascending order, and with the legend index it will also keep the legend in order.

Updated JSfiddle here.

Upvotes: 1

Related Questions