[Chartjs]-How to create a stacked graph using ChartJS

6👍

According to the docs of latest chartjs version, you need to set the stacked property to true in the axis you want to stack them. So in your case it would be:

       options: {
          scales: {
            yAxes: [{
              scaleLabel: {
                display: true,
                labelString: 'Income in $'
              },
              stacked: true
            }]
          }
        }

For more information go to ChartJs Docs

Leave a comment