Axis labels not presenting correct data in ShinobiCharts 2.5.x


#1

The first data point in that chart should say 29 Sep. Dragging the chart so that the first “30 Sep” axis label goes offscreen causes it to update to the correct value. What am I doing wrong here?

Further, looking at the underlying behaviour it appears that labels are not refreshed when reloadData or redrawChartIncludePlotArea:YES are called on the chart. stringForId is only called for labels that aren’t already displayed. 


#2

Looks like there might be some bogus logic in SChartCanvas’ layoutSubviews method — it appears that if a UILabel has already been setup for the axis data point, the value of the label will not be updated unless the label goes offscreen.


#3

I ended up subclassing SChartAxis and implementing the following fix:

- (void)addOrReplaceTickMarkForValue:(double)arg1 isMajor:(BOOL)arg2 isAlternate:(BOOL)arg3 autoCalc:(BOOL)arg4 shouldUpdateText:(BOOL)arg5 withTickLabelFrame:(struct CGRect)arg6 showLabel:(BOOL)arg7 showLabelFrequency:(int)arg8 withTickIndex:(int)arg9 numberOfGhosts:(int *)arg10
{
    [super addOrReplaceTickMarkForValue:arg1 isMajor:arg2 isAlternate:arg3 autoCalc:arg4 shouldUpdateText:YES withTickLabelFrame:arg6 showLabel:arg7 showLabelFrequency:arg8 withTickIndex:arg9 numberOfGhosts:arg10];
}