Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal tickIntervals should be disallowed for a category axis. #4217

Closed
jgerigmeyer opened this issue May 21, 2015 · 3 comments
Closed

Decimal tickIntervals should be disallowed for a category axis. #4217

jgerigmeyer opened this issue May 21, 2015 · 3 comments

Comments

@jgerigmeyer
Copy link

If using a category axis without setting allowDecimals: false, normalizeTickInterval can sometimes return a tickInterval of 2.5. This causes a tick.pos of 2.5, which in turn causes categories[pos] to be undefined and results in an incorrect label.

I would think this could be solved in a number of ways:

  1. Not calling normalizeTickInterval on a category axis, by adding && !categories to https://github.com/highslide-software/highcharts.com/blob/master/js/highcharts.4.1.4.js#L7412.
  2. Adding !!categories to the fourth arg passed to normalizeTickInterval: https://github.com/highslide-software/highcharts.com/blob/master/js/highcharts.4.1.4.js#L7420.
  3. Defaulting allowDecimals to false for a category axis.
@TorsteinHonsi
Copy link
Collaborator

Can you show a live demo of this? You can use http://jsfiddle.net/highcharts/as25s8ga/ as a starting point.

@jgerigmeyer
Copy link
Author

Sure. You can see a live demo of the bug at http://jsfiddle.net/jgerigmeyer/h705n915/.

I'm not sure if it only happens when you have two linked category axes, but that seemed to be the easiest way to demonstrate it.

@jgerigmeyer
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants