Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to plot data from right to left in MPAndroidChart?

I recently update the MPAndroidChart library from 1.7.4 to 2.0.9 and I forgot what I did to customize the linechart to make the data displaying from right to left. Does anyone know? I am wondering if there is a method to call to do that.

like image 519
Cao Felix Avatar asked Mar 17 '23 07:03

Cao Felix


1 Answers

There is no method. But it can still be done because it only depends on how you add the data.

Just add values at higher x-indices first.

Say you got a chart with x-axis labels from January to December with an x-axis range from 0 - 11 (12 values).

Now add the december value at index 11, and so on.

like image 139
Philipp Jahoda Avatar answered Apr 02 '23 15:04

Philipp Jahoda