Chart data points refreshing


#1

Hi all!

My application relatively frequently refreshes data points. I must  reload data by means of reloadData every time I wanna see the changes on the chart. This method reloads all data points (I didnt find any means how to reload a single data point like for example it does UITableView) what causes serious impact on chart performance (scrolling e.t.c). Is there any means to solve this?

Would be glad to hear any ideas, solutions.


#2

Greetings Program!

My understanding is that there isn’t a way to update a specific datapoint or range of datapoints into the chart (unless you’re appending); it still requests all the datapoints on reloadData. However, you could set the loadDataInBackground chart property to keep the UI thread free (https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiCharts/2.8.0/Premium/Normal/html/Classes/ShinobiChart.html#//api/name/loadDataInBackground):

chart.loadDataInBackground = YES;

Also, here’s an old post from 2013 regarding efficiently refreshing data (https://www.shinobicontrols.com/forum/shinobicontrols/2013/5/charts-efficiently-refreshing-data) in which Jan has some good suggestions that may still be useful.

Wg


#3

Hi,

I think we conversed via email, however I’ll also post my response here if any others are interested:

Unfortunately this isn’t something we currently support. However, I’ll certainly note down your interest as this is something we’re looking to add in the future.

For now, you may be able to work around this by creating a separate series which displays the penultimate and last datapoint and use the appendNumberOfDataPoints:toEndOfSeriesAtIndex: and removeNumberOfDataPoint:fromStartOfSeriesAtIndex: methods just on this extra series (i.e. you’ll need to remove the two datapoints and then append them with the updated data). This will cause the data to be reloaded for just this series, however I appreciate it’s not a very nice workaround.

Before trying the above however, it may be worth giving WizGod’s suggestion a try!

Many thanks,

Sam