mathkid91
mathkid91

Reputation: 679

Highcharts datalabels with gradient color

Is it possible to somehow trick in a gradient color for the datalabels in Highcharts??

This link shows a workaround to add gradient to a normal text. I have tried a few ways myself to add this into highcharts, but my ways seems to be overridden at some point.

In my case, the website will always run in a Chrome browser.

Upvotes: 1

Views: 89

Answers (1)

mathkid91
mathkid91

Reputation: 679

Turns out when I searched for my question a little differently, I found this question and answer showing how to add a background to the datalabels, and more importantly, how to treat the labels as HTML. Using this technique, I could use the information from my question link to color my labels :)

dataLabels: 
{
    useHTML: true,
    format: '<span class="my-class" style="...">My label</span>',
}

jsfiddle

Upvotes: 2

Related Questions