Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5020
Performance Tuning Multiple Graphs
posted

What is the best way to increase performance of multiple graphs on the same data set?

For example, 1200 data points are plotted on 3 charts:

Chart A) Two IGSplineSeries embedded in a IGRangeSelector

Chart B) Two IGLineSeries and one IGRangeAreaSeries

Chart C) Same as B: two IGLineSeries and one IGRangeAreaSeries

The iPad Air handles this data no problem.  However, an iPad Mini loses many frames on basic scrolling.  Here's an Instruments Time Profile with inverted call tree.

Thanks for your help!

#pragma mark - Chart Delegates

-(NSString*)chartView:(IGChartView*)chartView

         labelForAxis:(IGAxis*)axis

             withItem:(NSObject*)item

{

    NSString *label = nil;

    

    if ([axis isKindOfClass:[IGNumericYAxis class]])

        label = [((NSNumber*)item) stringValue];

    else if ([axis isKindOfClass:[IGCategoryDateTimeXAxis class]])

    {

        if([item isKindOfClass:[NSDate class]])

        {

            label = [self.dateFormatterDict[SemiPlotTimeFormatter] stringFromDate:(NSDate*)item];

        }

        

        else if([item isKindOfClass:[IGCategoryDatePoint class]])

        {

            

            IGCategoryDatePoint *datePoint = (IGCategoryDatePoint*)item;

            label = [self.dateFormatterDict[SemiPlotTimeFormatter] stringFromDate:datePoint.date];

        }

    }

    else

        DDLogVerbose(@"%s - axis class unknown:%@", __PRETTY_FUNCTION__, [axis class]);

    return label;

}

-(NSDateFormatter*)_timeFormatter

{

    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

    formatter.dateStyle = NSDateFormatterNoStyle;

    formatter.timeStyle = NSDateFormatterMediumStyle;

    return formatter;

}