Chart connecting data points out of sequence


#1

I have a line chart that contains 75 data points in a single series. Since updating to the latest version of Shinobi Charts (2.5.3) we have noticed that when there are more than 10 data points that the 11th data point will be connected with the last data point within the series, as seen in the screenshot below. Any ideas why this could be happening? The data/date arrays are in the appropriate order when loading these in the data source in the dataPointAtIndex method.

sample

 Thank you for your assistance!!


#2

Hi Philip,

This looks like an issue that we fixed in our recent 2.5.5 release. Could you download that and let us know if the issue persists?

Thanks,
Jan


#3

Thanks for the quick response!

The issue appears to persist after updating the framework to the 2.5.5 release. The chart looks the same with 2 non-adjacent data points being connected by the charted line. The newly added ShinobiChartLog header is present in Project Navigator, so I believe I was able to successfully replace the older version of your framework. 


#4

Hi Phillip,

This seems to be a strange one, sounds like it’s definitely an issue with 2.5.5 though. Is there a simple datasource you can provide that demonstrates this? I’m having trouble reproducing it on our end :S

Thanks!

Rob


#5

I was able to duplicate the issue by adapting the “Getting Started” project available in your Samples. You will need to  call the createDataArrays method from either early on in the viewDidLoad method, or call this method in the init of your datasource object in order to populate the data arrays. Let me know if you have any trouble.

Thanks again!

Phil

#pragma mark - SChartDatasource methods
 
- (NSInteger)numberOfSeriesInSChart:(ShinobiChart *)chart {
    return 1;
}
 
-(SChartSeries *)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
    
     SChartLineSeries *lineSeries = [[SChartLineSeriesalloc] init];
    lineSeries.style.showFill = YES;
    
    return lineSeries;
}
 
- (NSInteger)sChart:(ShinobiChart *)chart numberOfDataPointsForSeriesAtIndex:(NSInteger)seriesIndex {
     return_dataArray.count;
}
 
- (id<SChartData>)sChart:(ShinobiChart *)chart dataPointAtIndex:(NSInteger)dataIndex forSeriesAtIndex:(NSInteger)seriesIndex {
    
     SChartDataPoint *datapoint = [[SChartDataPointalloc] init];
    
    datapoint.yValue = [_dataArray objectAtIndex:dataIndex];
    datapoint.xValue = [_dateArray objectAtIndex:dataIndex];
    
    return datapoint;
}
 
-(void)createDataArrays {
    
     _dataArray = [[NSArrayalloc] initWithObjects:[NSNumbernumberWithInt:77],
                  [NSNumber numberWithInt:80],
                  [NSNumber numberWithInt:88],
                  [NSNumber numberWithInt:95],
                  [NSNumber numberWithInt:92],
                  [NSNumber numberWithInt:96],
                  [NSNumber numberWithInt:91],
                  [NSNumber numberWithInt:83],
                  [NSNumber numberWithInt:79],
                  [NSNumber numberWithInt:75],
                  [NSNumber numberWithInt:77],
                  [NSNumber numberWithInt:93],
                  [NSNumber numberWithInt:85],
                  [NSNumber numberWithInt:72],
                  [NSNumber numberWithInt:79],
                  [NSNumber numberWithInt:92],
                  [NSNumber numberWithInt:82],
                  [NSNumber numberWithInt:85],
                  [NSNumber numberWithInt:76],
                  [NSNumber numberWithInt:82],
                  [NSNumber numberWithInt:81],
                  [NSNumber numberWithInt:73],
                  [NSNumber numberWithInt:73],
                  [NSNumber numberWithInt:75],
                  [NSNumber numberWithInt:96],
                  [NSNumber numberWithInt:87],
                  [NSNumber numberWithInt:84],
                  [NSNumber numberWithInt:89],
                  [NSNumber numberWithInt:90],
                  [NSNumber numberWithInt:99],
                  [NSNumber numberWithInt:102],
                  [NSNumber numberWithInt:104],
                  [NSNumber numberWithInt:102],
                  [NSNumber numberWithInt:115],
                  [NSNumber numberWithInt:104],
                  [NSNumber numberWithInt:101],
                  [NSNumber numberWithInt:109],
                  [NSNumber numberWithInt:89],
                  [NSNumber numberWithInt:80],
                  [NSNumber numberWithInt:88],
                  [NSNumber numberWithInt:101],
                  [NSNumber numberWithInt:90],
                  [NSNumber numberWithInt:92],
                  [NSNumber numberWithInt:70],
                  [NSNumber numberWithInt:77],
                  [NSNumber numberWithInt:93],
                  [NSNumber numberWithInt:100],
                  [NSNumber numberWithInt:72],
                  [NSNumber numberWithInt:88],
                  [NSNumber numberWithInt:90],
                  [NSNumber numberWithInt:78],
                  [NSNumber numberWithInt:76],
                  [NSNumber numberWithInt:79],
                  [NSNumber numberWithInt:80],
                  [NSNumber numberWithInt:71],
                  [NSNumber numberWithInt:83],
                  [NSNumber numberWithInt:73],
                  [NSNumber numberWithInt:74],
                  [NSNumber numberWithInt:72],
                  [NSNumber numberWithInt:73],
                  [NSNumber numberWithInt:87],
                  [NSNumber numberWithInt:85],
                  [NSNumber numberWithInt:78],
                  [NSNumber numberWithInt:84],
                  [NSNumber numberWithInt:83],
                  [NSNumber numberWithInt:78],
                  [NSNumber numberWithInt:80],
                  [NSNumber numberWithInt:81],
                  [NSNumber numberWithInt:83],
                  [NSNumber numberWithInt:80],
                  [NSNumber numberWithInt:70],
                  [NSNumber numberWithInt:82],
                  [NSNumber numberWithInt:89],
                  [NSNumber numberWithInt:71],
                  [NSNumber numberWithInt:77], nil];
    
     NSDateFormatter *dateFormatter = [[NSDateFormatteralloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    
     _dateArray = [[NSArrayalloc] initWithObjects:
                  [dateFormatter dateFromString:@"2013-10-11 16:26:00"],
                  [dateFormatter dateFromString:@"2013-10-11 13:08:00"],
                  [dateFormatter dateFromString:@"2013-10-11 09:54:00"],
                  [dateFormatter dateFromString:@"2013-10-11 03:22:00"],
                  [dateFormatter dateFromString:@"2013-10-11 01:07:00"],
                  [dateFormatter dateFromString:@"2013-10-10 21:30:00"],
                  [dateFormatter dateFromString:@"2013-10-10 13:20:00"],
                  [dateFormatter dateFromString:@"2013-10-10 04:10:00"],
                  [dateFormatter dateFromString:@"2013-10-10 01:13:00"],
                  [dateFormatter dateFromString:@"2013-10-09 20:50:00"],
                  [dateFormatter dateFromString:@"2013-10-09 17:00:00"],
                  [dateFormatter dateFromString:@"2013-10-09 12:45:00"],
                  [dateFormatter dateFromString:@"2013-10-09 09:20:00"],
                  [dateFormatter dateFromString:@"2013-10-09 04:25:00"],
                  [dateFormatter dateFromString:@"2013-10-09 00:50:00"],
                  [dateFormatter dateFromString:@"2013-10-08 20:00:00"],
                  [dateFormatter dateFromString:@"2013-10-08 17:00:00"],
                  [dateFormatter dateFromString:@"2013-10-08 12:55:00"],
                  [dateFormatter dateFromString:@"2013-10-08 04:20:00"],
                  [dateFormatter dateFromString:@"2013-10-08 01:30:00"],
                  [dateFormatter dateFromString:@"2013-10-07 20:20:00"],
                  [dateFormatter dateFromString:@"2013-10-07 17:00:00"],
                  [dateFormatter dateFromString:@"2013-10-07 12:30:00"],
                  [dateFormatter dateFromString:@"2013-10-07 03:37:00"],
                  [dateFormatter dateFromString:@"2013-10-07 01:46:00"],
                  [dateFormatter dateFromString:@"2013-10-06 21:20:00"],
                  [dateFormatter dateFromString:@"2013-10-06 18:00:00"],
                  [dateFormatter dateFromString:@"2013-10-06 13:10:00"],
                  [dateFormatter dateFromString:@"2013-10-06 03:32:00"],
                  [dateFormatter dateFromString:@"2013-10-06 01:27:00"],
                  [dateFormatter dateFromString:@"2013-10-05 20:30:00"],
                  [dateFormatter dateFromString:@"2013-10-05 12:30:00"],
                  [dateFormatter dateFromString:@"2013-10-05 12:30:00"],
                  [dateFormatter dateFromString:@"2013-10-05 10:22:00"],
                  [dateFormatter dateFromString:@"2013-10-05 03:50:00"],
                  [dateFormatter dateFromString:@"2013-10-05 01:21:00"],
                  [dateFormatter dateFromString:@"2013-10-05 00:16:00"],
                  [dateFormatter dateFromString:@"2013-10-04 21:30:00"],
                  [dateFormatter dateFromString:@"2013-10-04 12:30:00"],
                  [dateFormatter dateFromString:@"2013-10-04 08:50:00"],
                  [dateFormatter dateFromString:@"2013-10-04 04:08:00"],
                  [dateFormatter dateFromString:@"2013-10-04 02:39:00"],
                  [dateFormatter dateFromString:@"2013-10-03 20:00:00"],
                  [dateFormatter dateFromString:@"2013-10-03 17:00:00"],
                  [dateFormatter dateFromString:@"2013-10-03 13:10:00"],
                  [dateFormatter dateFromString:@"2013-10-03 04:24:00"],
                  [dateFormatter dateFromString:@"2013-10-03 01:01:00"],
                  [dateFormatter dateFromString:@"2013-10-02 20:00:00"],
                  [dateFormatter dateFromString:@"2013-10-02 16:00:00"],
                  [dateFormatter dateFromString:@"2013-10-02 12:00:00"],
                  [dateFormatter dateFromString:@"2013-10-02 10:20:00"],
                  [dateFormatter dateFromString:@"2013-10-02 04:23:00"],
                  [dateFormatter dateFromString:@"2013-10-02 01:15:00"],
                  [dateFormatter dateFromString:@"2013-10-01 20:00:00"],
                  [dateFormatter dateFromString:@"2013-10-01 16:00:00"],
                  [dateFormatter dateFromString:@"2013-10-01 12:00:00"],
                  [dateFormatter dateFromString:@"2013-10-01 04:55:00"],
                  [dateFormatter dateFromString:@"2013-10-01 01:25:00"],
                  [dateFormatter dateFromString:@"2013-09-30 21:05:00"],
                  [dateFormatter dateFromString:@"2013-09-30 16:00:00"],
                  [dateFormatter dateFromString:@"2013-09-30 12:50:00"],
                  [dateFormatter dateFromString:@"2013-09-30 09:20:00"],
                  [dateFormatter dateFromString:@"2013-09-30 04:38:00"],
                  [dateFormatter dateFromString:@"2013-09-30 01:55:00"],
                  [dateFormatter dateFromString:@"2013-09-29 20:05:00"],
                  [dateFormatter dateFromString:@"2013-09-29 16:50:00"],
                  [dateFormatter dateFromString:@"2013-09-29 12:30:00"],
                  [dateFormatter dateFromString:@"2013-09-29 09:43:00"],
                  [dateFormatter dateFromString:@"2013-09-29 03:07:00"],
                  [dateFormatter dateFromString:@"2013-09-29 00:53:00"],
                  [dateFormatter dateFromString:@"2013-09-28 21:25:00"],
                  [dateFormatter dateFromString:@"2013-09-28 17:15:00"],
                  [dateFormatter dateFromString:@"2013-09-28 13:20:00"],
                  [dateFormatter dateFromString:@"2013-09-28 09:22:00"],
                  [dateFormatter dateFromString:@"2013-09-28 04:00:00"], nil];
}

#6

Thanks Phil! I haven’t reproduced your exact issue however I do get the last datapoint trailing down to zero.

Just to check - as you’re probably aware, Xcode sometimes caches old frameworks, and even if you see the new headers, it might be linking with an older chart library. If you log out [ShinobiChart getInfo], does this display 2.5.5 as the version?


#7

Hi Phil,

How are things going with this issue? I’ve taken a look as well, and I’ve been unable to replicate the bug with version 2.5.5 of charts. Did you find that upgrading your version of charts helped you?

Cheers,

Dan


#8

My appologies for the delay. It looks like Xcode had difficulties letting go of the older version of the library. Once I was able to force this to occur, the issue appears to be resolved.

Thank you for spending the time to look into this!!