1👍
✅
Solved.
- The solution is to maintain the code as it is
- The solution is here https://stackoverflow.com/a/43173498/3355243
- The solution is below
Applies the colors of the tooltips taking in consideration the dataset index.
options:
{
tooltips:
{
mode: 'index',
intersect: false,
callbacks:
{
labelColor: function(tooltipItem, chart)
{
var datasetIndex = tooltipItem.datasetIndex;
var borderColor = chart.legend.legendItems[datasetIndex].fillStyle;
var backgroundColor = chart.legend.legendItems[datasetIndex].fillStyle;
return {
borderColor: borderColor,
backgroundColor: backgroundColor
};
},
}
},
}
Source:stackexchange.com