@arturomoncadatorres ah, I did not realize you were using a “GroupBy Legend”. The reason there is only one item is because the real items and their order is only computed on the JavaScript side, in the browser. I am afraid I don’t have a good suggestion for you at the moment, if you want to keep using that feature, as there are not currently any user-facing hooks or properties that would affect the default ordering that is produced now. A GitHub issue to discuss adding some user-control over the order would be appropriate.
Otherwise, you will need to construct all the legend items (one for each group) all manually, using Explicit Indices into the data columns.