Chartjs-Chartjs: Multiple data values for the same label

0👍

Not sure if it will work but you can try to specify the data as an object and then in the first dataset put all the x values to the first label and in the second dataset put all the x values to the second label.
https://www.chartjs.org/docs/master/general/data-structures

0👍

Try this:

    labels: ['category 1, 'category 2'],
datasets: [
      {
        // values for category one
        type: 'bar',
        backgroundColor: '#8e5ea2',
        data: [111, 222, 333],
        stack: 'Stack 1'
      }, {
        // values for category two
        type: 'bar',
        backgroundColor: '#3e95cd',
        data: [111, 222, 333],
        stack: 'Stack 1'## Heading ##
      }
    ]

Leave a comment