Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  32] [ 3]  / answers: 1 / hits: 16079  / 8 Years ago, wed, april 27, 2016, 12:00:00

http://jsfiddle.net/n0mq739a/



enter



I'm trying to change the series legend text color from black, to anything besides black:



$(function () {
$('#container').highcharts({

legend: {
color: '#FF0000',
backgroundColor: '#FCFFC5'
},

xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},

series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});


});



This is all I found on the legend in the HighCharts docs, is there another way to change that color?



http://api.highcharts.com/highcharts#legend


More From » charts

 Answers
42

Here we go:



You need to specify itemStyle. e.g.



itemStyle:{'font-size':'30px'}


Depending on the css you want to use, you may also have to set 'useHTML'. From the documentation:



Using HTML allows for advanced formatting, images and reliable bi-directional text rendering.


Here is an example: http://jsfiddle.net/kHzr9/



Hope it helps;)


[#62378] Monday, April 25, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;