Chart.js: Dynamic Horizontal Bar Chart beginAtZero not working correctly

Created on 20 Nov 2017  Â·  1Comment  Â·  Source: chartjs/Chart.js

Hello guys. I have dynamic horizontal bar chart. When i put data for the first time it starts from 0 but if i change the data the beginAtZero functionality seems not working for the second data. Here is example. https://jsfiddle.net/nxsncsa4/3/ every time i want to show only 3 bars and change them with another random 3 bars to start from 0 but they start from > 0 after i change the data for the second time

Most helpful comment

Maybe I'm not interpreting your question correctly, however if your goal is to start the x-axis at 0,
you should add the beginAtZero: true for the xAxes instead of the yAxes.

>All comments

Maybe I'm not interpreting your question correctly, however if your goal is to start the x-axis at 0,
you should add the beginAtZero: true for the xAxes instead of the yAxes.

Was this page helpful?
0 / 5 - 0 ratings