如何更改highcharts中选定点的样式?

时间:2012-06-25 16:51:23

标签: highcharts

我想改变所选点的风格。当我选择点时它是灰色的。我希望我所选择的所有点都是红色的。

1 个答案:

答案 0 :(得分:18)

您将markers.state.select的样式设置为:

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

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

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

更新:对于条形图,配置应略有不同(不知道原因为何):

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

示例:http://jsfiddle.net/8truG/

相关问题