2

I'm using iOS-Charts library to make charts in my project. I tried to plot some reading against dateTime stamp. I converted the date object to milliseconds in order to make it as a double value which the line chart accepts. When I tried this method blank graph appears with labels and without any data points. That is shown in below screenshot. enter image description here

When I printed those data points using print() function I got the following.

ChartDataEntry, x: 1453871669.0, y 24.54
ChartDataEntry, x: 1453869902.0, y 24.84
ChartDataEntry, x: 1453869846.0, y 24.84

I doubt that it's because the x value too hight no point appears. If my doubt right please provide a solution to rectify this. Thanks in advance.

Praveen Kumar
  • 547
  • 1
  • 7
  • 33

1 Answers1

6

Nice to meet you my friend, cause I meet the same problem as well.

ChartDataEntry, x: 1453871669.0, y 24.54
ChartDataEntry, x: 1453869902.0, y 24.84
ChartDataEntry, x: 1453869846.0, y 24.84

Looks like your data are in a descending order right? Unfortunately that is the problem.If you sort them in a ascending order,I think you can see them all.

Maybe it's a bug of Charts.

Y.Bi
  • 657
  • 6
  • 11
  • 1
    yes this is the solution. Data is only accepted if it is in sorted order... this should really be made clear in the documentation... it took me so long to find this. – Dalton Sweeney Aug 16 '17 at 21:37