增加并固定点高图

问题描述 投票:0回答:1

我在图表上有问题!如何放大并固定点击的点?下面的图表示例,感谢您的帮助例如:http://jsfiddle.net/4bounhdg/

$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                cursor: 'pointer',
                marker: {
                    enabled: true,
                    symbol: 'circle',
                    radius: 6}, 
                point: {
                    events: {
                        click: function() {
                            for (var i = 0; i < this.series.data.length; i++) {
                                this.series.data[i].update({ color: '#7db7ed' }, true, false);
                            }
                            this.update({ color: '#0053ff'}, true, false);


                        }
                    }
                }
            }
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0]        
        }]
    });
});
highcharts
1个回答
0
投票

您可以在更新回调中设置较大的半径。

演示:http://jsfiddle.net/BlackLabel/rkqtcps8/

point: {
  events: {
    click: function() {

      this.update({
        color: '#0053ff',
        marker: {
            radius: 20
        }
      }, true, false);
    }
  }
}

API:https://api.highcharts.com/class-reference/Highcharts.Point#update

© www.soinside.com 2019 - 2024. All rights reserved.