Highstock / Highchart无法设定个人的一点颜色(Highstock/Highcha

2019-06-27 02:06发布

I am working on Highstock, I am trying to set a color to a specific point in "data" in Highstock, like in the example, but I couldn't get it to work, no matter how I set the color, it doesn't show on the graph.

I have tried the option with Highchart API, it works, but it doesn't work with Highstock.

jsfiddle link(what I have tried)

Is it because I am using x, y to specify the point? Please help.

Answer 1:

如果你看看你的演示中,你会看到使用color它设置提示的颜色,而不是marker

要修复它使用标记fillColor代替,像下面这样。

data: [
    {x: 1343862840000, y: 4, marker:{ fillColor: 'red'} },
    {x:1343863200000, y:5, marker:{ fillColor: 'green'}}
]

演示

更新
它适用于highstock看到这个演示。
您可以选择使用合适的对象来初始化它。
使用Chart来代替StockChart

参考

  • 点标记


Answer 2:

Highstock在默认情况下禁用点标记。 你需要让他们明确如下:

plotOptions: {
    series: {
        marker: {
            enabled: true    
        }
    }
},

多见于http://api.highcharts.com/highstock/plotOptions.series.marker



文章来源: Highstock/Highchart cannot set Individual Point color