如何禁用highcharts规格中的工具提示?

时间:2016-03-17 21:44:49

标签: javascript highcharts

我尝试禁用tooltip for gauge,但无论我做什么,它都无法正常工作。

我试图放置:

chart

paneseries $('#container').highcharts({ chart: { type: 'gauge', plotBackgroundColor: null, plotBackgroundImage: null, plotBorderWidth: 0, plotShadow: false, tooltip: { enabled: false } }, exporting: {enabled: false}, title: { text: 'meetings', //align: 'bottom' verticalAlign: 'bottom', y: 10, style: { fontWeight: 'bold', fontSize:'18px' } }, pane: { tooltip: { enabled: false }, startAngle: -150, endAngle: 150, background: [{ backgroundColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, '#FFF'], [1, '#333'] ] }, borderWidth: 0, outerRadius: '109%' }, { backgroundColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, '#333'], [1, '#FFF'] ] }, borderWidth: 1, outerRadius: '107%' }, { // default background }, { backgroundColor: '#DDD', borderWidth: 0, outerRadius: '105%', innerRadius: '103%' }] }, // the value axis yAxis: { tooltip: { enabled: false }, min: 0, max: max, minorTickInterval: 'auto', minorTickWidth: 0, minorTickLength: 0, minorTickPosition: 'inside', minorTickColor: '#666', tickPixelInterval: 0, tickWidth: 0, tickPosition: 'inside', tickLength: 0, tickColor: '#666', labels: { step: 2, rotation: 'auto' }, title: { text: '', y: 150, style: { fontWeight: 'bold', fontSize:'18px' } }, plotBands: [{ from: 0, to: color_threshold_values[0], color: '#DA2626' }, { from: color_threshold_values[0], to: color_threshold_values[1], color: '#F19E26' }, { from: color_threshold_values[1], to: color_threshold_max, color: '#88A61F' }] }, series: [{ name: 'Count', data: [data.count], dataLabels: { enabled:false, borderColor: 'red', borderWidth: 0, padding: 5, shadow: true, style: { fontWeight: 'bold', fontSize:'25px' } }, }] }); ...

以下是我使用的演示:Fiddle

这是一个代码:

var promiseResolve, promiseReject;

var promise = new Promise(function(resolve, reject){
  promiseResolve = resolve;
  promiseReject = reject;
});

promiseResolve();

有什么想法吗?

2 个答案:

答案 0 :(得分:3)

尝试将其添加到配置对象itslef?

http://jsfiddle.net/hesonazx/

$('#container').highcharts({
  tooltip: {
    enabled: false
  },
  chart: {
  ...
});

这是基于文档。请注意,toottip property for a guage type chart没有enabled选项。 general tooltip property does however

答案 1 :(得分:1)

您只需添加.highcharts-tooltip{opacity: 0;}

即可

请参阅小提琴http://jsfiddle.net/DIRTY_SMITH/dpyy732d/2/