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

Fix range calculation when all datasets hidden and axis minimum set #4425

Merged
merged 1 commit into from Jun 25, 2017

Conversation

etimberg
Copy link
Member

Resolves #4216

Cause

What happened in that bug was the following:

  1. All datasets hidden so x axis moves into default range
  2. X axis ticks.min property set which changes the default range
  3. The max of the x axis ended up being NaN hence why the axis drew incorrectly

Fix

To fix this, the range is checked after ticks.min and ticks.max are handled to ensure that the range is valid and that min < max.

… 0 - 1.

If `ticks.min` was set this would not set the range correctly.
Added a test to cover this case as well
@etimberg etimberg added this to the Version 2.7 milestone Jun 25, 2017
@@ -27,6 +27,9 @@ module.exports = function(Chart) {
}
}

var setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also handle min/suggestedMin === null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I'm not sure. The only way that could happen is if a user explicitly sets it (the default is undefined)

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

Successfully merging this pull request may close these issues.

NaN string displayed when clicking on legend to hide a horizontal bar chart with Y-axis labels as strings
2 participants