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 Axes does not support a ticks.min value of 0 (Zero) #7299

Open
PhilHowell opened this issue Apr 29, 2020 · 1 comment
Open

Logarithmic Axes does not support a ticks.min value of 0 (Zero) #7299

PhilHowell opened this issue Apr 29, 2020 · 1 comment

Comments

@PhilHowell
Copy link

@PhilHowell PhilHowell commented Apr 29, 2020

Documentation Is:

  • Missing or needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

I needed to produce a number of charts with a consistent yAxes logarithmic scale so that users can compare between charts.

I tried setting the same yAxes config settings for each chart:

beginAtZero: true
ticks.min: 0
ticks.max: <maximum-possible-data-value>

However the scale varied between charts depending on the data values. See example.

After much searching and trial and error it appears that the ticks.min=0 setting is ignored (probably because the logarithm of zero is not defined).

Your Proposal for Changes

In tick Configuration (https://www.chartjs.org/docs/latest/axes/cartesian/#tick-configuration) for 'min' description add a note such as:

(Note: logarithmic scales do not support minimum value of zero)

Example

https://codepen.io/phil-howell/pen/KKdvoKW

@benmccann
Copy link
Collaborator

@benmccann benmccann commented Apr 29, 2020

Any chance you can check if this is still true on master?
https://www.chartjs.org/dist/master/Chart.min.js
https://www.chartjs.org/docs/next/getting-started/v3-migration.html

We've made big improvements to the log chart and it may work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.