I tried to sort list order by mileage(Km). It was successful. Of cause chart is same direction. (20 -> 7 -> 13)
But I would like to reverse line chart.(13 -> 7 -> 20) order by date. So I wrote following code.
LineChartBarData(
spots: spots.reversed.toList()
)
But it does not work like following image. In my debugger, the list is reversed for sure.
What is wrong with it?
Finally I made it work.
I had tried to reverse spots
.
However I change my mind to reverse only ListView
.
ListView(
children: fuelComponents.reversed.toList(),
),
Thank you!!!