Sorting Category names in Stacked bar/column chart
In Stacked bar/column is there any way to sort the category names:
Example :
https://jsfiddle.net/vasjav1/ywspnocd/1/
it should be sorted as
['Apples', 'Bananas', 'Grapes', 'Oranges', ' Pears']
Available since v8.0.0:
https://api.highcharts.com/highcharts/series.column.dataSorting
-
Vasu commented
Hi,
Thanks for your response, yes it works perfectly if we are not using stacked chart. But if we sort data before chart render, we may need pass null values and it leaves blank columns in the chart. is there anyway to remove to blank category. Example for Apples, if there is no data i don't want to show empty category
-
Currently there isn't a way to do this by options, so you need to sort your data appropriately before applying them to Highcharts. Depending on your data, sorting is quite easy: https://jsfiddle.net/highcharts/s9mbrdaj/