-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
LineChart set a great amount data to LineChartDataSet, cpu increase highly to 97% #1063
Comments
Currently CoreGraphics is rendering over the CPU instead of the GPU. This is slow. There are other solutions. As in most cases - it's wrong anyway to add thousands of datapoints. |
|
Towards second one, have you checked |
@liuxuan30 i haven't tested it, and now i still don't know how to solve my problem. Android uses idea of point 3 to solve this problem. so i wonder how to use this properly with iOS? @danielgindi |
Has anyone else found a work around for rendering charts with more than 10K datapoints? I can render charts with 1-3K datapoints fine, but more than that it's very slow. With more than 36K datapoints, it never responds. thanks. |
I do think performance is issue, but right now you could use 3.6K or 360 to render..? sampling won't affect the chart shape a lot I think |
I know it's a bit excessive. It's accelerometer and gyroscope data recorded by the phone. I've thought of a few work arounds, but wanted to see what other solutions people have tried. The most obvious is to only show 1000 datapoints and use swipe gesture to scroll through the dataset. |
CoreGraphics cannot handle 36K of datapoints. We may use a different rendering engine to solve that- but you still need to use less datapoints. There's no user who can make use of this amount of data in a chart. You need to approximate the data, like GitHub does on their statistic charts on the site. |
thanks for taking time to respond. I thought about averaging, smoothing or other ways of approximating the data. I was curious to see what others have tried with crazy large datasets. thanks |
Well one way or another- approximating is the way to go. Take a look at the DataApproximator in Charts. |
thanks, I will take a look at DataApproximator. |
I just clone the latest version and didn't see an example using DataApproximator. If there isn't one, I'm happy write a sample and make a pull request. Thanks |
There isn't one, you are welcome to create one!
|
Have you solved this problem? |
Same here 5000 points ... cpu 100% |
`var yVals = ChartDataEntry
for yIndex in 0..<count {
yVals.append(ChartDataEntry(value: Double(value[yIndex]), xIndex: yIndex))
}
let lineChartDataSet = LineChartDataSet(yVals: yVals, label: "Audio Wave")
lineChartDataSet.drawCubicEnabled = true
lineChartDataSet.cubicIntensity = 0.2
lineChartDataSet.drawCirclesEnabled = false
lineChartDataSet.lineWidth = 1.8
lineChartDataSet.circleRadius = 4.0
lineChartDataSet.circleColors = [UIColor.whiteColor()]
lineChartDataSet.colors = [UIColor.greenColor()];
lineChartDataSet.fillColor = UIColor.whiteColor();
lineChartDataSet.fillAlpha = 1.0;
lineChartDataSet.drawHorizontalHighlightIndicatorEnabled = false
lineChartDataSet.drawVerticalHighlightIndicatorEnabled = true
lineChartDataSet.highlightColor = UIColor.whiteColor()
lineChartDataSet.highlightLineWidth = 2.0
`
and count may be a great number.while i setLineData,the cpu and memeory rise up highly
The text was updated successfully, but these errors were encountered: