SChartTickLabelRefreshRate usage


#1

Hi,

I looked at the documentation for SChartTickLabelRefreshRate Protocol and in the description it says panning and zooming may be CPU intensive and you can implement this protocol to control the  rate at which you want to refresh the tick label when panned or zoomed at the expense of slight lag of ticke label refresh.

This is exactly my issue where i have 17 charts with fair amount of data points. I want to implement this protocol and the required methods are 

 

  • – shouldRecalculate 

 

Decides whether or not the tick labels should be recalculated.

required method

  • – reset required method

However, there is no explanation of how i should implement these methods. No where it seems straight-forward on how i can control the refresh rate?

Please provide a brief description or better yet a sample


#2

Ok. I just returned false from shouldRecalculate and immediately I can see there is a lag in the label refresh which is ok. I will verify this on the devices (i have a couple of older iPad devices) and reply back. 

  1. Mean while can some one explain what I can do with the  reset  method?

  2. Also, where do I consume the SChartTickLabelRefreshRateDeviceBased Object? This class seems to be the one which can control the refresh rate.

A sample will help. Let me know

- (BOOL)shouldRecalculate{
    return false;
}

#3

Hi Veerun,

From what I can see you’re only after controlling the rate at which the tick labels refresh? If so, you will have to initialise an SChartTickLabelRefreshRateDeviceBased object setting the slow refresh rate and fast refresh rate within the init method. The slow refresh rate is applied to slower devices (iPad Mini 1, iPad 3rd generation and below and iPhone 4s and below) and the fast refresh rate is applied to everything else. The values you provide represent how many calls will happen before the tick labels are refreshed. For example 1 would refresh the tick labels every call whereas 10 would refresh the tick labels every tenth call. Finally just assign this to the tickLabelRefreshRate property available on the axis.

I hope this answers your question. If you need any further help please let me know.

Kind regards,

Matt