Where do i add the begin at zero (chart.js)

๐Ÿ‘:2

Assuming you mean for your linear y-axis then the documentation specifies the following:

options: {
  scales: {
    yAxes: [{
      ticks: {
        beginAtZero: true
      }
    }]
  }
}

Edit as per OP comment:

The options property is a sibling of type and data, e.g.:

{
  type: 'line',
  data: {
    labels: [...],
    datasets: [{
      data: [...]
    }]
  },
  options: {
    ...
  }
}

Leave a comment