Reputation: 1859
I'm using chart js, and I have multiple dataset...
I have a problem with the tooltips, indeed the square which should indicates the color of a dataset is always black..
Why?
Here the code:
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
}
}],
}
}
});
}
});
Here I have an array of color:
var backgroundColor = [
'#0db02bc7',
'#0daf87c7',
'#afaf0dc7',
'#0cb0aac7',
'#0c97b0c7'
];
Upvotes: 1
Views: 1812
Reputation: 3213
Your have that problem because you are using the hexadecimal code instead of the rgba.. Try to replace them..
Upvotes: 6