How to change series legend text color in HighChart chart?
13,484
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;)
Author by
Leon Gaban
Investor, Powerlifter, Crypto investor and global citizen You can also find me here: @leongaban | github | panga.ventures
Updated on June 15, 2022Comments
-
Leon Gaban almost 2 years
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?
-
Leon Gaban about 8 yearsThanks! So just adding here for others, how I changed it in my actual app:
vm.config.options.legend.itemStyle.color = '#fff';