我使用图表js,我有多个数据集......
我的工具提示有问题,实际上应该指示数据集颜色的方块总是黑色。
为什么?
这里是代码:
my_list[index] if my_list[index:] else default
这里我有一个颜色数组:
fattureChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: mydatasets
},
options: {
responsive: true,
tooltips: {
mode: 'index',
intersect: false,
},
animation:{
easing: 'easeOutElastic',
duration: 2500
},
plugins: {
filler: {
propagate: true
}
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'PERIODO'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'EURO'
},
ticks: {
beginAtZero:true
}
}],
}
}
});
}
});
答案 0 :(得分:2)
你有这个问题,因为你使用的是十六进制代码而不是rgba ..尝试替换它们..