Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change style of selected point in highcharts?

Tags:

highcharts

I want to change style of selected points. When i select point it is gray. I want all my selected point to be red.

like image 876
Dmytro Plekhotkin Avatar asked Dec 01 '22 05:12

Dmytro Plekhotkin


1 Answers

You set the style for the markers.state.select as:

    plotOptions: {
        series: {
            allowPointSelect: true,
            marker: {
                states: {
                    select: {
                        fillColor: 'red',
                        lineWidth: 0
                    }
                }
            }
        }
    }

Example: http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-marker-states-select-fillcolor/

Reference: http://www.highcharts.com/ref/#plotOptions-scatter-marker-states-select

Update: For barcharts the configuration should be slightly different (don't know why really):

plotOptions: {
    series: {
        allowPointSelect: true,
        states: {
            select: {
                color: 'red'
            }
        }
    }
}

Example: http://jsfiddle.net/8truG/

like image 176
eolsson Avatar answered Dec 09 '22 20:12

eolsson