highcharts / highcharts-react

The official Highcharts supported wrapper for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected series order when adding linkedTo series

demaMarcos opened this issue · comments

Hey! I hope someone can help me with this small (but very annoying) issue. I have tried to boil it down from a more complex system

Steps to reproduce:

Screenshot 2024-04-08 at 22 07 08
  • Press Update series
Screenshot 2024-04-08 at 22 07 53

At this point you can see how nicely it is ordered red -> red opacity -> blue -> blue opacity as expected

  • Add linkedTo: uuid1 in serie with id: uuid1 + "compare" and linkedTo: uuid2 in serie with id: uuid2+"compare"
  • Press Update series
Screenshot 2024-04-08 at 22 11 41

Here the order of the columns is not the same as the series array, we see red -> blue -> red opacity -> blue opacity. This is the annoying situation since I would expect the same order as the happy case without linkedTo.
It seems to be conflicting with colors somehow. Removing that property makes it work after updating the series but it feels like it should work either way.

Hello demaMarcos,

Thanks for contacting us!

By defining the linkedTo property, the ordering algorithm for the series is changed, because of the connections between them. You can override this behavior by using the index property for each. Kindly take a look: https://stackblitz.com/edit/react-dnmhyq?file=index.js.

Kind Regards!

This worked like a charm! Thanks for the help 🙌