Chartjs-How to get the bands to implement in Chart.js the band extension?

0👍

As I don’t know your code I can just tell you how it should be done.

https://jsbin.com/yiyejumaye/1/edit?html,js,output

options: {
  bands: {
    yValue: 40,
    baseColorGradientColor: [
      'rgb(255, 100, 100)'
    ],
    bandLine: {
      stroke: 2, 
      colour: 'rgba(100, 100, 255, 1)',
      type: 'solid',
    },
  }
}

Note that my import in the JSBin is easier but it’s an older release. You shouldn’t use that in your application. It’s just easier for a JSBin.

Leave a comment