How to change style of selected point in highcharts?

白昼怎懂夜的黑 提交于 2019-12-22 08:23:43

问题


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


回答1:


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/



来源:https://stackoverflow.com/questions/11193658/how-to-change-style-of-selected-point-in-highcharts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!