Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chart.js: colouring tooltip labels

I can't find it in the docs, does anyone know how I can make those grey squares in the tool tip the same color as the lines, and potentially label each one? (High, Low, Average)

like image 545
Christopher Reid Avatar asked Apr 22 '26 11:04

Christopher Reid


1 Answers

It looks to me like you're not setting properly the pointColor property on your datasets.

For each of your datasets, just set pointColor to the same value as strokeColor.

Something like, in the first dataset :

    strokeColor: "rgba(1,220,1,1)",
    pointColor: "rgba(1,220,1,1)",

And in the second dataset :

    strokeColor: "rgba(220,1,1,1)",
    pointColor: "rgba(220,1,1,1)",

And so on...

Here's a jsfiddle to illustrate the point : http://jsfiddle.net/rdtome/aa2j9rut/.

like image 132
rtome Avatar answered Apr 25 '26 00:04

rtome