Control order of series in linechart legend

Currently the ordering seems to vary randomly after reloading data, e.g.
How to control the order?