Attempting to update axis data range with nil series min or max. Axis range not updated


#1

Hi guys, 

I just can’t get rid of this error and am desperately looking for a solution since I believe that this is the culprit for another issue I’m having with a RangeSelector.

Anyway, all I’m doing is initialising a line chart without any data. Not even calling reloadData or redrawChart, just the basic init code with a NumberAxis and DateTimeAxis. Given that I don’t have any data at the point of initialisation, no range has been set.

Other than the dataSource (again, doesn’t have any data yet) and the two axes, nothing has been done with the chart, yet it still somehow tries update the data range for both axes.

Any help would be highly appreciated!

Cheers!

Edit: One “solution” I’ve found is to return 0 for “numberOfSeriesInSChart” in case no data is available at the moment. Though that logs a message I suppose that that’s fine, isn’t it?


#2

Hi Maximilian,

I’m a little confused as to how you came about the error message " Attempting to update axis data range with nil series min or max. Axis range not updated." Since you must provide a datasource to the chart, and the method -numberOfSeriesInChart: is a required method, you must have been returning something from it prior to returning 0?

It sounds to me as though your datasource was telling your chart that it had series, but no datapoints. The chart is then attempting to automatically update its range to span your datapoints, but it can’t update to a range of 0 or nil, so it skips the update. This error message is probably a little superflous. All that is happening under the hood is that the range is being set to our default of -0.5 - 0.5 for both the X and the Y axis.

We’ve got a task in our backlog to improve our error logging so that users can disable / enable certain levels of logging, but I don’t have any timescale as to when that will be available. I’ll raise this scenario in our back log so that we’re aware another user has encountered the problem, and we’ll get back to you when we’ve had a chance to improve the chart’s logging.

With regards to the best solutions: it doesn’t really matter. Whether you provide 0 series, or 1 series with 0 datapoints, the chart isn’t doing anything dangerous so it shouldn’t affect your development (apart fromt the needless log!  :laughing:)

If you’ve got any further questions feel free to give us a shout either here, or via info@shinobicontrols.com.

Best regards,
Jan Akerman


#3

I forgot to mention that you can disable logging completely by doing the following:

[ShinobiChartLog setLoggingEnabled:NO];

Although this obviously comes with its own draw backs!

Jan


#4

Thanks Jan, your explanation about the chart attempting to update its range was likely the problem. I was indeed returning nil instead of nil since no datapoints have been calculated at the time of initialisation.

Glad to hear that this isn’t doing anything bad in the background.

The log message (“datasource for this chart has specified that there are 0 series”) is fine for me, so no worries about that. A little granularity in terms of log levels certainly wouldn’t hurt, though.  :wink:

Again, thanks a lot for your extensive support, appreciate it!

Highly enjoying working with ShinobiCharts thus far. Great product that saved us months of development.  :money_mouth:  :wink:

Regards,

Max