最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - HighstockHighchart cannot set Individual Point color - Stack Overflow

programmeradmin3浏览0评论

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.

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.

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Aug 15, 2012 at 19:42 leonleon 10.4k20 gold badges61 silver badges81 bronze badges 1
  • stackoverflow./questions/11985901/… possible duplicate – Jugal Thakkar Commented Aug 19, 2012 at 6:03
Add a ment  | 

2 Answers 2

Reset to default 12

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

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./highstock/plotOptions.series.marker

发布评论

评论列表(0)

  1. 暂无评论