2013-01-14 77 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没有密钥。