如何改变highchart中选定点的风格? [英] How to change style of selected point in highcharts?

查看:172
本文介绍了如何改变highchart中选定点的风格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变选定点的样式。当我选择点时,它是灰色的。我希望所有选定的点都是红色的。

解决方案

您为设置样式marker.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



更新:对于barcharts,配置应该略有不同(不知道为什么):

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


code
$ b示例:http://jsfiddle.net/8truG/


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

解决方案

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/

这篇关于如何改变highchart中选定点的风格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆