[Chartjs]-How to change bar fillColor in chart.js bar char

4👍

rgba stands for red green blue alpha. The parameters are as follows:

rgba(x, y, z, w)
  • x: amount of red (0-255)
  • y: amount of green (0-255)
  • z: amount of blue (0-255)
  • w: alpha value (opacity). 1 is fully opaque, 0 is fully transparent

You can also specify Hex values as colours:

{
    fillColor : "#ffff00",
    strokeColor : "#000000",
    data : [65,59,90,81,56,55,40]
}

or predefined colour names instead if you don’t want to use rgba values:

{
    fillColor : "yellow",
    strokeColor : "black",
    data : [65,59,90,81,56,55,40]
}

Leave a comment