I need to sort a categorized stacked columns in Highcharts (sorting categories by totals and in each column, sorting series to ascending/descending).
I found the topic Highcharts: Sort column stack order to ascending that seems to be a great solution to achieve that.
The result is visible here : https://jsfiddle.net/vegaelce/0ye9objs/
The two things I would like to conclude are:
1/ place correctly the value labels (they don't follow the series sorting). I tried to change the datalabel y position with :
stackedPoint.dataLabel.y = plotY;
without success
2/ make functional the click on legend (when you clic on Jane for instance it does not result the expected behaviour). If it's not possible : just disable the click and let available the hover
Thanks
I've updated the example a bit. There is an additional
sortStacksfunction, which is called on chart load. Moreover, data-labels positions are corrected by usingattrmethod and hidden series are ignored in thesortSeriesfunction.Live demo: http://jsfiddle.net/BlackLabel/8fp96u1r/
API Reference: https://api.highcharts.com/class-reference/Highcharts.Series#setData