Render speed problems with massive datasource (thousands datapoints)


#1

Hello.

ShinobiCharts - Version: 2.7.3-1, Edition: Premium, Release Date: Sep  9 2014

We have need to dsiplay thousands of datapoints, basically it is historical data mesured every hour or every minute.By default Shinobi does very good job with handling such amount of data allowing precise and responsive user interaction (live zooming, scrolling etc)

This is why we love ShinobiCharts !

But after we trying to customize labels on X axis with:

xAxis.majorTickFrequency = [context dateFrequency];

effectively setting it to 1 hour tickmarks to prevent automatic appearance of minutes labels when user zooms chart enough to see minutes.

We end up to see ALL major Tick marks as shown on screenshot:

xAxis here contains about 1300 datapoints for each hour and effectively the same number of majorTickMarks.

Default ShinobiCharts algorythm is not applied anymore and we see ALL majorTickMarks onscreen. That would never happen if we did not set majorTickFrequency.

Obviously user interaction with this chart is impossible due to huge delays with zooming/moving the chart. Famous ShinobiChart performance is gone.

To fix the problem we tried different approaches with the goal to remove unnecessery tickMarks from teh screen. We did our own subclass for xAxis

@implementation BIDateTimeAxis
 - (void) alterTickMark:(SChartTickMark *)tickMark {
     if (nil == tickMark.tickLabel) {
         // case 1: does not improve speed much: [tickMark disableTick: self];

       // case 2: even worse than 1
         tickMark.tickEnabled = NO;
         tickMark.tickMarkView.hidden = YES;
     }
 }
 @end

Also we are looking at sChart:majorTickValuesForAxis: possibility, but that looks like we need too much computation to filter out many tickmarks dynamically, based on the current zoom level. Looks like it would not be easy thing to implement.

So, we are looking for the solution which would combine default Shinobi super effective tickMarks management algorythm and custom xAxis.majorTickFrequency

Any advice please?


#2

Hi deem0n,

Thanks for getting in touch!

This is feature quite a few users have requested and we do have a task in our backlog to investigate this feature.

As a work around solution, we’d recommend making your own tick frequency calculator which calculates the tick frequency you wish to use depending on your axis range’s span value.

Using the SChartDelegate method “sChart:isZooming:” you can set the axis’ major tick frequency depending on the span ofyour axis’ range.

For example, if the span of the range is less than a day you set the tick frequency to be a few hours. If the user zooms out and the axis’ range span increases to a week you can set the major tick frequency to be a day.

Let me know how you get on.

Kind regards,
Andrew Polkinghorn