beginAtZero ignored in line-chart
I want to use Chart.js to draw a time-line graph of values that can not have a negative value. - Think about CPU-load (floating-point value between 0.0 and a lot), network-throughput (bytes/s).
The timescale graph in Chart.js 2.0 appears to be a good fit, but it looks weird if the base-line is drawn at the center of the graph. (which happens if you draw a lot of values between 0.08 and 0.2).
I get the impression that beginAtZero is ignored in the line-chart.
@stephanarts beginAtZero should work, though the config has changed since V1. Here's a JSBin with the beginAtZero option. You can try changing it and seeing the effect.
@etimberg I see what you mean, I was aware of the config-change and it does work. - sometimes.
It appears to be related to the x or y values assigned to the dataset.
If I assign the values hard-coded as strings in my js file, it works. If I retrieve them as a JSON object from an AJAX call it doesn't work. Let me check where the difference is coming from.
I am clueless as to why it didn't work earlier... I must have done something terribly wrong.
@etimberg: thank you for confirming the location of the beginAtZero option in v2.0 :-)
@stephanarts glad its fixed. Let me know if you see it again and I'll give it a stress test.
@etimberg I managed to reproduce it here: http://jsbin.com/dusesimiqa
I see the issue. The relevant lines are: https://github.com/nnnick/Chart.js/blob/v2.0-dev/src/scales/scale.linear.js#L103-L106
@stephanarts a fix is in #1581
Confirmed.