gpt4 book ai didi

javascript - Highcharts 更改单个系列的标签文本

转载 作者:行者123 更新时间:2023-11-29 19:44:05 25 4
gpt4 key购买 nike

在我的堆叠条形 Highcharts 中,您会看到我已将最后一个系列设置为灰色。有没有办法将系列背景颜色为灰色的文本颜色设置为黑色?

plotOptions: {
series: {
stacking: 'percent',
},
bar: {
stacking: 'percent',
dataLabels: {
enabled: true,
format: '{y}%',
style: {
color: '#ffffff' //This is where i set the color to white
}
}
}
}

http://jsfiddle.net/jimbob25/V446C/

最佳答案

您可以为每个系列单独设置颜色,请参阅:http://jsfiddle.net/V446C/5/

series: [{
name: 'Poor',
color: '#E9E9E9',
data: [12, 23, 13, 18, 7, 19, 9],
dataLabels: {
style: {
color: '#000000'
}
}
}, {
name: 'Satisfactory',
color: '#629AC0',
data: [42, 45, 35, 57, 29, 61, 26]
}, {
name: 'Excellent',
color: '#006FBC',
data: [46, 32, 52, 25, 64, 20, 65]
}]

关于javascript - Highcharts 更改单个系列的标签文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21139696/

25 4 0