国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - How to modify the color of a specified bar in chart.js
曾經(jīng)蠟筆沒(méi)有小新
曾經(jīng)蠟筆沒(méi)有小新 2017-07-05 11:05:48
0
2
866

I am using chart.js to make a bar chart, and I hope to modify the color of a certain data bar. Does anyone know how to do it?
My code is as follows

function drawChart(chartid,datalist,label){
var ctx = document.getElementById(chartid).getContext("2d");
var myChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: label,
        datasets: [{
            label:'訪問(wèn)次數(shù)',
            data: datalist,
            backgroundColor: [
                'rgba(54, 162, 235, 0.5)'
            ],
        }]
    },
    options
});    
}

For example, if I want to modify the color of the first data, how should I write it in js? Thank you all.

曾經(jīng)蠟筆沒(méi)有小新
曾經(jīng)蠟筆沒(méi)有小新

reply all(2)
Ty80

Declare the variable array externally, then write the color you set in it, and then pass the parameters into the setting item

過(guò)去多啦不再A夢(mèng)

fillColor property

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template