Chartjs-PHP render stacked area chart of JSON dataset

0👍

You should try setting the type as “line” and the “stacked” setting in the yAxes options:

scales: {
  yAxes: [{
    stacked: true,
  }]
},

In addition, you missed a comma “,” between the 2 datasets objects.
Here’s a Codepen working example of a stackedArea chart.

If you could provide the JSON response from the server, we can check if the data is suitable to work with Chart.js.

Leave a comment