-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Always show 0 on Bar chart axis #8
Comments
I've harcoded this in my fork: |
I agree. On the list of todos for the next major release. |
Wow, can't believe this isn't available! I'll look elsewhere for bar charts. :-( |
This is a most flabbergasting flaw. Unbelievable that this beautiful plugin missed a fundamental business criteria like that. Both bars and lines need this option of course. |
Line charts need to start at 0 as well. Keep your original code though, Fox News will love it. xD |
I'm not sure if I agree that line charts should always start at zero, visual context at a small size is difficult when a scale a lot larger than the change itself. Though there is a new option for doing this - pass For bar charts, this now defaults to true. |
This new feauter should be in http://www.chartjs.org/docs/#line-chart documentation. |
For chartjs 2.0 I've found the solution. Put this in the options object.
|
hi, I've tried your solution but it didn't work for me - I found on stack other answer (http://stackoverflow.com/questions/43040867/show-bar-with-zero-value-in-chartjs-v2/), but it's more hack than solution - can you show on jsfiddle how exactly you soultion works? |
same here- doesn't work for me, and I would like my y axis to begin at zero! |
@bartekmaciejewski @nickgrossman Not sure if you still need it, it works for me with: var config = {
type: 'bar',
data: {
...
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
}; |
@chesstrian the solution is not working for me, but i am able to find a solution from a site https://www.dyclassroom.com/chartjs/how-to-create-a-bar-graph-using-chartjs where they are using min option for y axis, which can solve few of our requirements
|
Bar chart axis should always include a 0.
— Stephen Few
If there is a need to break this it should be set up as an option override.
Test: http://jsfiddle.net/QwCKB/
The text was updated successfully, but these errors were encountered: