首页 文章

如何从highcharts JAVASCRIPT悬停时删除外部阴影

提问于
浏览
0

我在摆脱了我所做的高图周围的阴影后,目前有一个阴影悬停在饼图区域上,如下图所示:

我也是在饼图中心获取文字之后 .

Example

这是代码:

$(function() {
    // Create the chart
    Highcharts.setOptions({
    colors: ['#26d248', '#323232']
});

    chart = new Highcharts.Chart({
      chart: {
            renderTo: 'summoner-pie-container',
            type: 'pie',
             backgroundColor:'transparent'

        }, plotOptions: {

        series: {
            marker: {
                states: {
                    hover: {
                        enabled: false
                    }
                }
            }
        },

        pie: {
            borderWidth: 0
        } 
    },


      title: {
text: '',
style: {
    display: 'none'
}
}, credits: {
  enabled: false
}, exporting: {
    buttons: {
        contextButton: {
            enabled: false
        }    
    }
 },
 tooltip: {
            formatter: function() {
                return '<b>'+ this.point.name +'</b>: '+ this.y;
            }
        },
        series: [{
            data: [["Damage Dealt",34000],["Team Damage Dealt",86423]],
            size: '60px',
            innerSize: '70%',
            dataLabels: {
                enabled: false
            }
        }]
    });


   });

http://jsfiddle.net/HpdwR/1994/

1 回答

  • 1

    在您的工具提示设置中:

    tooltip: {
        formatter: function() {
            return '<b>'+ this.point.name +'</b>: '+ this.y;
        }
    },
    

    你需要添加 shadow: false

    tooltip: {
      formatter: function() {
            return '<b>'+ this.point.name +'</b>: '+ this.y;
      },
      shadow: false
    }
    

    此外,在 plotOptions 中,您需要基本上删除对象中的 marker 图层,如下所示:

    plotOptions: {        
        series: {
            states: {
                hover: {
                    enabled: false
                }
            }
        },
    

    (Working Fiddle)

相关问题