Chartjs-ChartJS – TypeError: Cannot read property '_model' of null – Angular

0πŸ‘

βœ…

To find the problems, I write the array of data in my html template …

I replace this :

this.dataType = [{
  data: this._consoAir[this.id - 1],
  label: 'Consommation Air'
}];

By this in HTML :

<canvas baseChart
            [datasets]="[{
      data: this._consoAir[0],
            this._consoAir[1],
            ...
            this._consoAir[9],
      label: 'Consommation Air'
    }]"
...

Leave a comment