MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

How to show chart data with given time gap automatically on X axis

Open Aastha-dev opened this issue 3 years ago • 2 comments

Hi Folks, Greetings of the day!


Suppose I have three values in X axis:

  1. 10:00 AM
  2. 12:00 PM
  3. 08:00 PM

Now I want com.github.mikephil.charting.charts.LineChart to display values automatically within time period. If the data (ILineDataSet) contains 11:00 AM then it should be drawn between 10:00 AM &12:00 PM automatically.


I'm using v3.1.0-alpha currently. Can anyone tell me the method to achieve it? How do I set the gap in the Entry(x:Float)?


Thanks In Advance! :)

Aastha-dev avatar Jun 18 '22 11:06 Aastha-dev

I also have this problem.

GingerBread153 avatar Sep 14 '22 13:09 GingerBread153

use timestamp to have a continuous interval , so add 3 visible label :

10:00 AM
12:00 PM
08:00 PM

note that the number of labels (visible and invisible ) must be equal to the number of entities

mahditavakoli1312 avatar Jan 21 '23 10:01 mahditavakoli1312