BUG#93595. Auto detect how to sort source data to draw a line correctly