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

Logarithmic Scale Tick Bug for values of 0 #3917

Closed
crwh05 opened this issue Feb 16, 2017 · 3 comments
Closed

Logarithmic Scale Tick Bug for values of 0 #3917

crwh05 opened this issue Feb 16, 2017 · 3 comments

Comments

@crwh05
Copy link

crwh05 commented Feb 16, 2017

I have a similar scenario as issue #2966.

Expected Behavior

I wish to show the difference between values with large differences in values and some with a value of 0 too.

I want to show 0 as a value so the tooltip can still be seen for that data value because if I set the 0 values to 'null' the tooltip doesn't display and you can't see a little sliver of a bars border to indicate a data value is there. This is particularly an issue where several values are 0 beside each other, you cannot easily see how many are there when there are no labels under them. e.g.
image
https://codepen.io/crwh05/pen/xgeROm

Current Behavior

The scales are not displaying correctly. I know this is an issue with log(0) being undefined but I thought the fix #3016 solved this problem.
For some reason, the first tick is being displayed below 0 on the y scales. This only happens when a value is 0.

image

https://codepen.io/crwh05/pen/ggywQY

If the first scale tick could be displayed in the correct place above the 0 tick then the chart would be perfect for my use.

Environment

  • Chart.js version: 2.4.0
@roicos
Copy link
Contributor

roicos commented Feb 16, 2017

Thanks for your comment, I'll try to figure out with it.

@crwh05
Copy link
Author

crwh05 commented Feb 20, 2017

Does anyone have a work around for this till the next version is released?

@roicos
Copy link
Contributor

roicos commented Feb 23, 2017

I'm almost ready with pr, but need a couple of days to test everything.

@roicos roicos mentioned this issue Feb 25, 2017
@etimberg etimberg modified the milestones: Version 2.7, Version 2.6 Apr 22, 2017
@simonbrunel simonbrunel modified the milestones: Version 2.7, Version 2.8 Sep 11, 2017
jcopperfield added a commit to jcopperfield/Chart.js that referenced this issue Nov 1, 2017
 - issue chartjs#3917: Logarithmic Scale Tick Bug for values of 0
 - issue chartjs#4380: LogLog plots are impossible (0, 0)
 - issue chartjs#2966: chart does not render if data contains value of 0 when using logarithmic scale
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