0
我想爲我的餅圖指定某個部分的顏色。爲餅圖指定顏色Highchart
我寫了這樣的代碼,但它似乎不工作。任何人都知道如何解決這個問題?
{
name: data[i].status,
color: function() {
if (data[i].status === "Working") {
return '#60a57c';
} else if (data[i].status === "Stopped \/ Idle") {
return '#e7494d';
} else if (data[i].status === "Transport") {
return '#fac101';
} else if (data[i].status === "Headland Turning") {
return '#66cc13';
}
},
y: data[i].val
}
基本上我想要的是如果status
是"Working"
,然後我們指定的顏色爲"#60a57c"
,等我不希望我HighChart自動生成的顏色。
謝謝。
感謝爲我工作。 – sozhen 2012-08-08 21:10:51
@SongtaoZ不客氣。 – 2012-08-08 21:11:46