Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highstock/Highchart cannot set Individual Point color

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.

like image 391
leon Avatar asked Aug 15 '12 19:08

leon


2 Answers

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
like image 199
Ricardo Alvaro Lohmann Avatar answered Nov 03 '22 01:11

Ricardo Alvaro Lohmann


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

like image 29
leon Avatar answered Nov 03 '22 00:11

leon