Line and area charts - stack values problem

Line and area charts - stack values problem

Hi, how to do stack chart in correct way?
I try do it (left side of screenshot) but as You see, lines are crossing, but why?
Values have different timestamps, because it is not possible to synchronize all IoT devices to send data in one second.