Make chart data sorted