我使用chart.js来绘制条形图。如何在chart.js中更改条形填充颜色。(我使用“条形图”)
var data = {
labels : ["January","February","March","April","May","June","July"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
data : [28,48,40,19,96,27,100]
}
]
}
fillColor : "rgba(220, 220, 220, 0.5)
是什么意思?如何更改此颜色?
1条答案
按热度按时间pprl5pva1#
rgba代表绿色蓝alpha。参数如下:
您也可以将Hex values指定为颜色:
如果不想使用RGBA值,则使用预定义的colour names: