I need to show multiple charts (up to 16) in 1 UIScrollView, each with a single line series representing temperature data. The data comes in live from thermometers, potentially 1 reading per second, and gets stored for displaying on the chart. You can potentially have tens of thousands of data points per chart.
I can plot historical data ok but get serious performance issues over time with the chart updating live. CPU usage spikes to over 100% meaning that the app locks up. Also, memory usage goes very high (over 300MB) just to plot the initial data.
My datasource uses sChart:(ShinobiChart*)chart dataPointsForSeriesAtIndex:(NSInteger)seriesIndex to pre-create the data points. To update the charts, I add the new reading to the datasource, call chart.append(numberOfDataPoints: 1, toEndOfSeriesAtIndex: 0) then call chart.redraw(). I’ve also enabled loadDataInBackground.
Is there anything else I can do to improve performance? Am I trying to plot too much data?