SChartCategoryAxis, bounce & allowPanningOutOfMaxRange


Hi Guys,

I have a y category axis which has more categories than can be comfortably displayed in the available chart height. I’ve set a default range and enabled panning which works well, however when you pan to either end of the range I’m getting odd behaviour. Where _allowPanningOutOfMaxRange _is enabled the chart will scroll past the end category, seemingly for ever. Where it’s disabled I get a very abrupt bounce going past the last (bottom) category and no bounce at all, just an immediate stop, going past the top category.

SChartCategoryAxis *yAxis = [[SChartCategoryAxis alloc] init];
yAxis.enableGesturePanning = YES;
yAxis.enableGestureZooming = YES;
yAxis.enableMomentumPanning = YES;
yAxis.enableMomentumZooming = YES;
yAxis.rangePaddingHigh = @1;
yAxis.rangePaddingLow = @1;
yAxis.defaultRange = [[SChartNumberRange alloc] initWithMinimum:@0 andMaximum:@6];

yAxis.allowPanningOutOfDefaultRange = YES;
yAxis.allowPanningOutOfMaxRange = YES;
yAxis.animationEdgeBouncing = YES;
yAxis.animationEnabled = YES;

I’m I doing something wrong? I’d like to get a smooth bounce when you go just past the first or last category.


Issue with SChartCategoryAxis

I found a solution. At the sChartRenderFinished: method, you must set the defaultRange and axis range to the value you may know.

That's works for me.