通过highcharts增加饼图大小的悬停? [英] Increase pie chart size onhover with highcharts?

查看:304
本文介绍了通过highcharts增加饼图大小的悬停?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在弄乱图表,想知道是否可以在悬停时增加饼图的大小?我已经尝试过这样的事情:

I am messing around with highcharts and was wondering if it was possible to increase the size of the pie chart upon hover? I've tried something like this:

plotOptions: {
    pie: {
        allowPointSelect: true,
        cursor: 'pointer',
        size: 100,
        showInLegend: true,
        dataLabels: {
            enabled: false
        },
        hover: {
            pie: {
                size:200
            },
        },
    }
},

推荐答案

您可以在mouseOver/mouseOut事件中更新饼图系列的size以获得所需的结果:

You can update the size of the pie series in mouseOver / mouseOut events to achieve the desired result:

events: {
  mouseOver: function() {
    this.update({
      size: 300
    });
  },
  mouseOut: function() {
    this.update({
      size: 200
    });
  },
}

实时演示: http://jsfiddle.net/kkulig/vhh95L3d/

API参考: https://api .highcharts.com/class-reference/Highcharts.Series#update

这篇关于通过highcharts增加饼图大小的悬停?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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