-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Performance problem with LineCharts #322
Comments
Hi, |
Not sure if you can work with this, but i copied the entire class and hardcoded values and wrote some comments.
|
To Reproduce |
I met same thing - all you need is scale chart date and just show right numbers - than it will work fine |
Im sorry, i don't quite understand. Can you please elaborate ? |
Looks like with bigger number chart will draw more points. I suppose if 96k on y axis it draws at least 96k times, so you can try to descale your chart so you can draw from 0 to 96 instead of 0 to 96k and show user the number multiplied by 1k. So at the very top of the chart you will have for example point (6, 96), and you may show you see the point (6, 96k) it will work, an your chart will not be laggy. I use maximum up to 100 points for each axis and it works perfectly. P. S. The chart by it own may have up to a 100 maximum on x and on y, and you just fit you point in this value |
Hi, i uploaded the app, please take a look. Hope this helps : https://github.com/Wizzel1/corona |
@imaNNeoFighT was the repo helpful to you ? |
Hi, I didn't have time to check it and apologize, |
It doesn't help me, |
I can confirm that there's definitely a performance problem with line charts working with dates in milliseconds. I divided also by 100000 to get it running. But with increasing points, it has difficulties to build, sometimes it's building until it crashes the whole app. Trying to provide an example soon. |
I've created a sample chart in examples at my forked repo: https://github.com/igoriuz/fl_chart If you turn useRawMilliSeconds to true, dates won't be divided through 100000 and you'll see the crashing behaviour. Just for some context: Theres a dummy object which holds the date in milliseconds for the x axis and a temperature value for the y axis. For each day i just create one FlSpot. This means for last 7 days, there are just 7 spots. This example works really well unless you turn useRawMilliSeconds to true. |
Hi @igoriuz |
All these three files from this commit: igoriuz@e1ce52b |
Okay I'm on it. |
I'm unsure but i think i noticed that LineCharts can't work with null values for y axis. Thank you very much! |
Hi, |
It fixed my problem. Thank you very much. |
You're welcome. |
@imaNNeoFighT yes, way better ! |
Great, |
…d grid lines, it prevents performance issues, like imaNNeo#101, imaNNeo#322.
Hi, i am making a Coronatracker app.
I am implementing a LineChart Widget with the Data for each day.
The maxY is equal to the tracked days (number of days since 22nd January)
The maxX is equal to the highest number of confirmed cases divided by 100000 (working with the absolute number took the chart forever to build)
Everything works as intended, but it impacts the smoothness of the scrolling of the singlechildscrollview, in which the chart is implemented.
Do you have any suggestions ?
The text was updated successfully, but these errors were encountered: