如何在highcharts中更改折线图中折线图的颜色?
现在,这条线显示为蓝色。如果我希望是这样呢,瑞德?
现在我有以下代码:
new Highcharts.Chart({
chart: {
renderTo: 'emissionsChart',
type: 'areaspline',
marginRight: 20
},
legend: {
layout: 'vertical',
align: 'center',
verticalAlign: 'top',
x: 0,
y: 40,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF'
},
xAxis: {
labels: {
formatter: function() {
return this.value.toFixed(0);
}
}
},
yAxis: {
title: {
text: 'Emissions (tCO2e)'
}
},
credits: {
enabled: false
},
plotOptions: {
areaspline: {
fillOpacity: 0.5
}
},
series: [{"name":"High reduction rate","data":[]}]
});发布于 2013-06-12 00:06:33
您可以在plotOptions中指定您想要的任何颜色,以及其他许多内容:
http://api.highcharts.com/highcharts#plotOptions.series.color
您也可以通过将属性添加到series对象来逐个序列地执行此操作:
http://jsfiddle.net/jlbriggs/yPLVP/8/
series:[{
color:'orange',
data:[5,2,8,9,6,3,4,7,7]
}https://stackoverflow.com/questions/17048365
复制相似问题