I'm new with MPAndroidChart and I would like to display time on the XAxis of a LineChart in real time. I wanna display only the 10 last seconds of the incoming data like the image below. My sampling is at 25Hz so I need to display 250 values to have 10 seconds of record.
However, I really don't know how to do that. I think I have to use the IAxisValueFormatter.
For the moment, my incoming values are added the the dataset like this :
addEntry(myDataSet, new Entry(myDataSet.getEntryCount(), myNewValue));
but maybe I need to do this :
/* add 40 ms on xAxis for each new value */
addEntry(myDataSet, new Entry(myLastTimeStamp + 40, myNewValue));
and then create a formatter that convert the X values to a string like "xxx seconds" and display only "0s", "5s" and "10s".
I don't know if it works butis there a better way to do this ?
Thx