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

Stacked Logarithmic axes with a 0 data point crashes page #4473

Closed
NJLucyk opened this issue Jul 6, 2017 · 2 comments
Closed

Stacked Logarithmic axes with a 0 data point crashes page #4473

NJLucyk opened this issue Jul 6, 2017 · 2 comments

Comments

@NJLucyk
Copy link

NJLucyk commented Jul 6, 2017

Expected Behavior

Chart should not break page

Current Behavior

Chart breaks page

Possible Solution

Steps to Reproduce (for bugs)

Go to https://jsfiddle.net/kadeyuy/r190msc6/18/ and change the stacked from false to true and hit run and the page will crash.

Context

Trying to have a stacked logarithmic bar graph so that I can show how different data sets contribute to total number while also being able to see smaller data points.

Environment

  • Chart.js version: 2.6
  • Browser name and version: Chrome Version 59.0.3071.115 (Official Build) (64-bit)
@NJLucyk
Copy link
Author

NJLucyk commented Jul 6, 2017

Looks like the problem is that minNotZero is not set. The code for that is at

if (opts.stacked || hasStacks) {
which leaves me.minNotZero equal to null instead of setting it.

Adding

if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
    me.minNotZero = value;
}

To the bottom of the if clause appears to fix the problem.

@jcopperfield
Copy link
Contributor

@etimberg This issue has been addressed through PR #4959.

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

4 participants