Christopher Reid
Christopher Reid

Reputation: 4484

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)

Upvotes: 3

Views: 1932

Answers (1)

rtome
rtome

Reputation: 1993

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/.

Upvotes: 3

Related Questions