Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
89
rated 0 times [  93] [ 4]  / answers: 1 / hits: 28207  / 12 Years ago, mon, june 25, 2012, 12:00:00

So I know how to change the color of x-axis labels in Highchart, which is described here.



http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/labels-style/



But what if I want to change the color of just ONE label, not all the labels? How do I apply style to individual labels?


More From » highcharts

 Answers
42

You can also use the label-formatter to set the style. Full example on jsfiddle:



labels: {
formatter: function () {
if ('Jun' === this.value) {
return '<span style=fill: red;>' + this.value + '</span>';
} else {
return this.value;
}
}
}


enter


[#84690] Saturday, June 23, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronniem

Total Points: 584
Total Questions: 111
Total Answers: 111

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
ronniem questions
Sat, Apr 24, 21, 00:00, 3 Years ago
Wed, Mar 10, 21, 00:00, 3 Years ago
Sat, Feb 6, 21, 00:00, 3 Years ago
;