score:0

Accepted answer

you can add an empty label and to the start of the labels array and a null value to the start of your dataarray to shift it a bit

example:

var options = {
  type: 'line',
  data: {
    labels: ["", "red", "blue", "yellow", "green", "purple", "orange"],
    datasets: [{
      label: '# of votes',
      data: [null, 12, 19, 3, 5, 2, 3],
      borderwidth: 1,
      fill: false,
      bordercolor: 'red',
      backgroundcolor: 'red'
    }]
  },
  options: {
    scales: {
      yaxes: [{
        ticks: {
          reverse: false
        }
      }]
    }
  }
}

var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
new chart(ctx, options);
<body>
  <canvas id="chartjscontainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.9.4/chart.js" integrity="sha512-hzf9qhp3rldjbvakvmig+goaakrza6lkuo35ok6esm0/kjpk32yw7urqrq3q+nvbbt8usss+iekl7crn83dymw==" crossorigin="anonymous"></script>
</body>

score:0

is there a way like this?

enter image description here

i wish it would look from that number, not from 0.


Related Query

More Query from same tag