luujam1
Posts: 10
Joined: Tue Aug 09, 2022 12:25 pm

Sorting columns by group

Fri Nov 25, 2022 1:14 am

see fiddle: https://jsfiddle.net/bm190ynd/

I'd like to be able to numerically sort the data within a group instead of within series. So for first group "A" I'd like it to be sorted to have the first value of series Z (0), first value of series X (20) and then first value of series Y (90).

Is it possible to sort this data without modifying the series itself? i.e. the legend colours stay the same
Thanks

hubert.k
Posts: 1149
Joined: Mon Apr 11, 2022 11:48 am

Re: Sorting columns by group

Fri Nov 25, 2022 10:45 am

Hi luujam1!
Thanks for contacting us with your question!

Of course, it is possible. A similar question was already asked on our Forum. You can find the original link here: viewtopic.php?f=9&t=40820

I have also added the necessary code to your demo, you can check it below.

Demo: https://jsfiddle.net/BlackLabel/v7s5qog9/

Let me know if you have any further questions.
Regards!
Hubert Kozik
Highcharts Developer

luujam1
Posts: 10
Joined: Tue Aug 09, 2022 12:25 pm

Re: Sorting columns by group

Fri Nov 25, 2022 2:47 pm

Awesome, thanks!

hubert.k
Posts: 1149
Joined: Mon Apr 11, 2022 11:48 am

Re: Sorting columns by group

Fri Nov 25, 2022 2:48 pm

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”