用Highcharts画了张曲线图,由于风格需要,将图的背景颜色设为了黑色,其他的字符颜色设为了白色,现在,title,x-title,y-title以及x轴和y轴以及曲线颜色都设置为合适的颜色了,唯独series中的那个name的颜色,没办法设置,大手们给指点下如何搞。代码如下:var chart2;
chart2 = new Highcharts.Chart({
chart: {
backgroundColor: '#3C3C3C',
renderTo: 'container2',
type: 'bar'
},
title: {
text: title,
style: {
color:'#FFFFFF'
}
},
xAxis: {
categories: x_value,
title: {
text: x_title,
style: {
color:'#FFFFFF'
}
},
labels:{
style: {font: 'normal 10px 宋体',
color:'#FFFFFF'
}
}
},
yAxis: {
min: 0,
title: {
text: y_title,
align: 'high',
style: {
color:'#FFFFFF'
}
},
labels:{
style: {font: 'normal 10px 宋体',
color:'#FFFFFF'
}
}
},
tooltip: {
enabled: false,
formatter: function() {
return ''+
this.series.name +': '+ this.y;
}
},
plotOptions: {
bar: {
color:'#EA7500',
dataLabels: {
enabled: false
}
}
},
credits: {
enabled: false
},
series: [{
name: kpi_name,
data: y_value,
}]
});
chart2 = new Highcharts.Chart({
chart: {
backgroundColor: '#3C3C3C',
renderTo: 'container2',
type: 'bar'
},
title: {
text: title,
style: {
color:'#FFFFFF'
}
},
xAxis: {
categories: x_value,
title: {
text: x_title,
style: {
color:'#FFFFFF'
}
},
labels:{
style: {font: 'normal 10px 宋体',
color:'#FFFFFF'
}
}
},
yAxis: {
min: 0,
title: {
text: y_title,
align: 'high',
style: {
color:'#FFFFFF'
}
},
labels:{
style: {font: 'normal 10px 宋体',
color:'#FFFFFF'
}
}
},
tooltip: {
enabled: false,
formatter: function() {
return ''+
this.series.name +': '+ this.y;
}
},
plotOptions: {
bar: {
color:'#EA7500',
dataLabels: {
enabled: false
}
}
},
credits: {
enabled: false
},
series: [{
name: kpi_name,
data: y_value,
}]
});
name: '<b style="color:red">北京</b>',
series: [{
name:'<b style="color:red">'+ kpi_name+'</b>',
data: y_value,
}]