Automatic scaling not starting at zero

Hi, I have the following code for a bar chart that has a very simple data set of integers:

    <title>ChartJs Test</title>
    <script src=""></script>

      <div style="width: 75%%">
        <canvas id="canvas"></canvas>

        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


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

Author: Fantashit

2 thoughts on “Automatic scaling not starting at zero

Comments are closed.