SChartCategoryAxis doesn't respect SChartNumberRange setting


#1

There seems to be a bug in the SChartCategoryAxis class that doesn’t allow the initial view of the graph to use a set minimum and maximum range. If in the code below I use SChartNumberAxis, then it works perfectly and shows the subset of category values. Switching it back to SChartCategoryAxis causes the complete category range to appear when the chart is displayed. If this is a bug, do you have a workaround?

SChartNumberRange *r = [[SChartNumberRange alloc] initWithMinimum:[NSNumber numberWithInt:minimumRange] andMaximum:[NSNumber numberWithInt:maximumRange]];

SChartCategoryAxis *xAxis = [[SChartCategoryAxisalloc] initWithRange:r];

 Additional Information: The category axis categories array is empty until the second reload and redraw of the chart. If I load the chart a second time and try to set a range min and max, then it works. I can’t figure out a shortcut to getting the first pass to set the min and max range. It simply reports that it can’t find a category for the indexes.


#2

Hi Kevin,

This is a known issue with our category axis. We are having a minor release which will include this bug fix in the next week or two. I hope this doesn’t cause you too much inconvinience.

Jan


#3

Hi Jan,

We can certainly handle waiting a week or two for a fix as long as it’s coming. Thank you for the prompt reply.

Kevin


#4

Jan

Hi Kevin,

This is a known issue with our category axis. We are having a minor release which will include this bug fix in the next week or two. I hope this doesn’t cause you too much inconvinience.

Jan

I ask you this small version of the next release of the specific time, our project is now impossible because of this bug, thank you


#5

Hi Jan,

With the release of iOS 7 and Xcode 5 GMs today, our shipping window with MoneyWell for iPad has shrunk dramatically. Any chance the fix for this is coming in the next couple of days?

Kevin


#6

Hello Kevin,

This issue should have been fixed in our latest minor release (2.3.1). Can I ask which version of ShinobiCharts you are using?

Jan


#7

Hi Jan: getInfo reports “Version: 2.3.0-SNAPSHOT”, so I guess and update occurred since I posted this bug. What’s the best way to get updates and make sure we stay on the latest?

UPDATE: I found the customer portal download page. Thanks.


#8

Did it fix your bug, Kevin? I’m seeing some odd behaviour from category axes as well that sounds similar to what you experienced here (although I’m already running 2.3.1).


#9

Tony: I’m having a hard time figuring out when I can set the range. I’ve tried right after a reloadData on a chart, but the category x-axis is still reporting a -0.5 to 0.5 range at that point and ignores my call below that tries to set it to the last 7 columns of the chart, which may have a few dozen. The error message is gone, but this still does nothing if I have the min and max set to 6 and 13, for example:

        [self.columnChart.xAxis setRangeWithMinimum:@(minimumRange) andMaximum:@(maximumRange)];

#10

Hi Guys,

Can I ask if you see the same issue on our latest release? - 2.5.0 This is available from our CRM or as a trial here: http://www.shinobicontrols.com/ios/shinobicharts/price-plans/shinobicharts-premium/shinobicharts-free-trial-form/

The category axes issues should have been fixed here, although please note that you need to call [chart redrawChart] after calling setRangeWithMinimum:andMaximum:. Hope this helps!

Best regards,

Rob


#11

I was able to get it working with the 2.3.1 release by setting the range in the sChartDidFinishLoadingData delegate method:

- (void)sChartDidFinishLoadingData:(ShinobiChart *)chart
{
     [selfsetDefaultZoomRange];
}
 
- (void)setDefaultZoomRange
{
    CGFloat maximumRange = [self.planPeriods count] - 1.5;
    CGFloat minimumRange = maximumRange - 7;
    [self.columnChart.xAxis setRangeWithMinimum:@(minimumRange) andMaximum:@(maximumRange)];
     [self.columnChartredrawChart];
    NSLog(@"setRange to %f and %f for xAxis %@", minimumRange, maximumRange, self.columnChart.xAxis);
}