This is not as much about the legend @Larry_Gregory, as about the 'Order By' being broken for split-series.
(i.e. forget about the 'legend' - it's not that important really).
There is a bug that can be shown using your demo here
Now - WinXP, count for 'error' (25), is bigger than count for 'login'(21) - but they come in different order.
Play with 'Ascending' vs 'Descending' and this seems persistent. I see this issue elsewhere in my Kibana graphs and noticed the following too:
-
looks like the sorting might be applied to 'majority' of events, thus outliers will be sorted in a wrong way (not individually)? Why??
-
changing value of 'Size' affects the issue (for some reason I see that going above 5 exposes it, but might be a coincident and this is really a result of the 'majority-sorting' above)
I belive odrer of labels simply follows this 'majority sorting'. And it would also explain why @Xavier_Romero can see it 'sometimes' ( I can see it on my graps 'sometimes' too: probably this is when 'majority' flips things in the 'wrong' way..
Could this be looked into / solved? If not, what is the best way to AVOID this issue and, for bar charts (not necessarily for charts like attached here) - make them 'show the truth' and not 'lie' about the order for points where this order changes? Some other charts that can be used?
Thank you!
Update:
Now there might be even a bigger bug there, when, in the above 'demo' example I reduce 'size' for X-axis aggregation to 4, chart goes awry.. and:
- number of X-axis points does NOT decrease to 4 (should this be expected?)
- some tags go missing (in IOS only 3 left, etc)
Again - play yourself here to see this in 'action'.
Seems not right to me, or it requires a really good explanation..