Highstock/Highchart cannot set Individual Point color

前端 未结 2 1397
情书的邮戳
情书的邮戳 2020-12-19 06:42

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 ho

相关标签:
2条回答
  • 2020-12-19 06:48

    Highstock has point markers disabled by default. You will need to enable them explicitly as follows:

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

    See more at http://api.highcharts.com/highstock/plotOptions.series.marker

    0 讨论(0)
  • 2020-12-19 07:05

    If you look to your demo you'll see that using color it sets the tooltip color and not the marker.

    To fix it use marker fillColor instead, like the following.

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

    demo

    Update:
    It works on highstock see this demo.
    You have to init it using the right object.
    Use Chart instead of StockChart.

    reference

    • point marker
    0 讨论(0)
提交回复
热议问题