Automatic scaling not starting at zero
See original GitHub issueHi, I have the following code for a bar chart that has a very simple data set of integers:
<html>
<head>
<title>ChartJs Test</title>
<script src="http://www.chartjs.org/dist/2.6.0/Chart.bundle.js"></script>
</head>
<body>
<div style="width: 75%">
<canvas id="canvas"></canvas>
</div>
<script>
var barChartData = {
labels: ["January", "February", "March"],
datasets: [{
label: 'Dataset 1',
data: [2, 3, 1]
}]
};
window.onload = function() {
var ctx = document.getElementById("canvas").getContext("2d");
window.myBar = new Chart(ctx, {
type: "bar",
data: barChartData
});
};
</script>
</body>
</html>
You can see in the js fiddle that there are two visual issues. Firstly the scale does not start at zero giving a false impression of the data, and also the scale on the left has decimals places even though the data is only integers. Why is this? Am I missing something? Cheers
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Troubleshoot scaling issues with an Amazon EC2 Auto ... - AWS
Amazon EC2 Auto Scaling can't evaluate a CloudWatch scaling policy for suspended Terminate, Launch, or Alarm Notification processes.
Read more >How To SET The Value of AxisY Starts from ZERO ... - Telerik
My requirement is The AxisY starts with Zero and want to enable the auto scaling or auto range is TRUE. Both are not...
Read more >Auto-scale y-axis always defaults to zero - Mr. Excel
I'm graphing multiple stock charts. The auto-scale for the high works perfectly (if a stock reached, say, $50 over the past year, then...
Read more >Can my auto scaling group have zero running instances? : r/aws
Set both Desired AND Minimum to zero. Desired in your case allows it to terminate all instances but if Min > 0 then...
Read more >Auto-scaling your functions - OpenFaaS
But the function will not be set to zero yet, it will be brought up to the minimum range which is 1. Scaling...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@burt202 You can add
beginAtZeroto your scales configuration, which will allow you to specify that the scale starts at 0. Here is an updated jsfiddle: https://jsfiddle.net/9bgeu5rx/1/https://github.com/chartjs/Chart.js/issues/4537#issuecomment-316820751
This solution is not working