2013-01-14 83 views
3

可能重複:
Highstock/Highchart cannot set Individual Point colorHIghcharts各個描繪點顏色

目前使用addPoint功能更新highcharts圖形,某些點需要強調/不同的顏色......我在api參考中找不到一個方法來做到這一點,這有可能嗎?

//exampleA - Series arrayId 
//exampleB - Point value 
//exampleC when not null would has extra tooltip info, these points need to be a different color. 

addPoint: function(exampleA, exampleB, exampleC) 
{ 
    mcjs.chart.series[exampleA].addPoint({ y: exampleB, exampleC }); 
} 
+0

And http://stackoverflow.com/questions/7737409/set-different-colors-for-each-column-in-highcharts/7739047#7739047 –

回答

5

是的,這是可能的。

您已更改Data屬性內Marker內的fillColor屬性。

data內部的color屬性沒有爲我工作。

如果你想要一個綠點,你可以看看this example I made

2

是 - 顏色是您傳遞給addPoint的選項對象中的一個選項。以下是addPointhere's提供給您的選項的說明。

你的代碼應該結束了尋找或多或少這樣的,如果你說想要一個綠色的點 -

mcjs.chart.series[exampleA].addPoint({ fillColor: "#659355", y: exampleB, exampleC }); 

眼下雖然你傳遞的對象並不完全看有效的 - 你需要爲每個值匹配一個鍵; exampleC沒有密鑰。