Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No chart data available (displaying large data sets) #4075

Closed
varunjitsingh6410 opened this issue Jul 22, 2019 · 5 comments
Closed

No chart data available (displaying large data sets) #4075

varunjitsingh6410 opened this issue Jul 22, 2019 · 5 comments

Comments

@varunjitsingh6410
Copy link

varunjitsingh6410 commented Jul 22, 2019

Hi all, I am attempting to generate a line chart but keep getting a no chart data message. I have tested the code and made sure the data is present.

During one of the tests I attempted to print out the contents of dataPoints (declaration: var dataPoints: [ChartDataEntry] = []) which caused huge lag in the console and was not finished printing after ~10 minutes.

The data set has 162239 pairs of X and Y coordinates. My theory is that the large size of the data set is the issue based on the laggy print statement described above and the fact the code works on smaller data sets.

The code structure is something as follows if that helps:

  1. Populate dataPoints with X/Y coordinates
  2. Initialize LineChartDataSet with dataPoints
  3. Initialize LineChartData object with the set
  4. Set graph.data equal to the data object

Print statements set between the above steps in my code print in a reasonable time frame so my guess is that its something in the Charts visualization process that's causing my bug. The code needs to be able to plot around ~4 million data points by the end of the project.

Are there any work arounds that will let me display large data sets using Charts? I can not sacrifice any of the data points due to the nature of the project. Thank you in advance for any assistance!

@Garenge
Copy link

Garenge commented Aug 5, 2019

I have the same problem like you, but I only have 2188 points. I can feel that my phone is very hard to show my view. I can easily display 400 points.

@varunjitsingh6410
Copy link
Author

Hi Liu, I am still seeking a solution. Did you figure anything out?

@liuxuan30
Copy link
Member

The data set has 162239 pairs of X and Y coordinates

I doubt you can draw this on a smart phone screen... just sampling it to 1622 or smaller

@varunjitsingh6410
Copy link
Author

I was able to visualize the data set when I switched it from a line to a scatterplot. I tested the scatterplot with data up to 4 million X-Y pairs, although it started to lag noticeably once we got into the millions.

@Garenge
Copy link

Garenge commented Aug 8, 2019

Hi Liu, I am still seeking a solution. Did you figure anything out?

I tried another way. No matter how many points I have, I only show 200 points. Users need to scroll the view to see more.
After I set data to the charts view, call the method [_lineView setVisibleXRangeMaximum:200];
Search "setVisibleXRangeMaximum" in your project and try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants