Multicategory sorted by date

I’m plotting sensordata with a few different SI-units(Liter, kWh, m³ etc.).

When I don’t group by SI-unit the xaxis-type is date, and missing data is no problem. If trace1(sensor1) has data starting at January 1st, and trace2 has data starting at May 1st, the data is still sorted by date.

When I use unit as category in the same scenario, the plot starts at May 1st, and January 1st to April 30th for trace1 comes after the dates where trace1 and trace2 overlaps.

x: [timestamps, _.times(timestamps.length, i => { return unit })]

How can i sort by date while using SI-unit as a category?