禁用HighCharts上的悬停 [英] Disable hover on HighCharts

查看:1165
本文介绍了禁用HighCharts上的悬停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HighCharts库构建饼图,这里是我的图表:

  // http:// jsfiddle .net / t2MxW / 20890 / 

var chart = new Highcharts.Chart({
colors:['#0072BC','#BFDAFF','#DDDF00','#24CBE5' ,'#6​​4E572','#FF9655','#FFF263','#6AF9C4'],
学分:{enabled:false},
图表:{
renderTo:'container' ,
backgroundColor:'rgba(255,255,255,0.1)',
类型:'pie',
保证金:[0,0,0,0],
您可以使用以下代码来创建一个文本文件:spaceTop:0,
spacingBottom:0,
spacingLeft:0,
spacingRight:0
},
title:{text:null},
plotOptions :{
pie:{
allowPointSelect:false,
size:'100%',
dataLabels:{enabled:false}
}
},
系列:[{
showInLegend:false,
类型:'pie',
名称:'Pie Chart',
data: [
['Mobile',65],//馅饼前半段
['Other',35] //下一个馅饼
]
}]
});

但问题是我不想在鼠标上显示工具提示...



是否可以禁用悬停的工具提示?

解决方案

您需要设置工具提示属性为 false ,如下所示:

  tooltip:{enabled:false},

< a href =http://jsfiddle.net/t2MxW/21135/> jsFiddle here






$ p
$ b

  var chart = new Highcharts.Chart({
colors :$#$ b credit:{'#0072BC','#BFDAFF','#DDDF00','#24CBE5','#64E572','#FF9655','#FFF263','#6AF9C4' enabled:false},
tooltip:{enabled:false},
chart:{
renderTo:'container',
backgroundColor:'rgba(255,255,255,0.1 )',
类型:'派,
margin:[0,0,0,0],
spacingTop:0,
spacingBottom:0,
spacingLeft:0,
spacingRight:0
$,
title:{text:null},
plotOptions:{$ b $ pie:{
allowPointSelect:false,
size:'100%',
dataLabels:{enabled:false}
}
},
series:[{
showInLegend:false,
type:'pie',
名称:'饼图',
数据:[
['Mobile',65],//上半部分
['Other',35] //下半部分
]
}]
});


I have building a pie chart using HighCharts library, and here is my chart:

 // http://jsfiddle.net/t2MxW/20890/

    var chart = new Highcharts.Chart({
        colors: ['#0072BC', '#BFDAFF', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
        credits: { enabled: false },
        chart: {
               renderTo: 'container',
               backgroundColor: 'rgba(255, 255, 255, 0.1)',
               type: 'pie',
               margin: [0, 0, 0, 0],
               spacingTop: 0,
               spacingBottom: 0,
               spacingLeft: 0,
               spacingRight: 0
        },
        title: { text: null },
        plotOptions: {
               pie: {
                   allowPointSelect: false,
                   size: '100%',
                    dataLabels: { enabled: false }
               }
       },
       series: [{
               showInLegend: false,
               type: 'pie',
               name: 'Pie Chart',
               data: [
                     ['Mobile', 65], // first half of pie
                     ['Other', 35] // second half of pie
               ]
       }]
    });

But the problem is that I don't want appearing tooltip on mouse over...

Is it possible to disable tooltip on hover?

解决方案

You need to set the tooltip attribute to false, like so:

tooltip: { enabled: false },

jsFiddle here


Here's the full code for your case:

var chart = new Highcharts.Chart({
       colors: ['#0072BC', '#BFDAFF', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
       credits: { enabled: false },
       tooltip: { enabled: false },
       chart: {
              renderTo: 'container',
              backgroundColor: 'rgba(255, 255, 255, 0.1)',
              type: 'pie',
              margin: [0, 0, 0, 0],
              spacingTop: 0,
              spacingBottom: 0,
              spacingLeft: 0,
              spacingRight: 0
       },
       title: { text: null },
       plotOptions: {
              pie: {
                  allowPointSelect: false,
                  size: '100%',
                   dataLabels: { enabled: false }
              }
      },
      series: [{
              showInLegend: false,
              type: 'pie',
              name: 'Pie Chart',
              data: [
                    ['Mobile', 65], // first half of pie
                    ['Other', 35] // second half of pie
              ]
      }]
});

这篇关于禁用HighCharts上的悬停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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