Javascript 如何防止highcharts工具提示弹出窗口隐藏,在图形区域或浏览器窗口上调整大小?
调整图形区域或浏览器窗口的大小后,鼠标在highcharts中不会显示工具提示弹出窗口Javascript 如何防止highcharts工具提示弹出窗口隐藏,在图形区域或浏览器窗口上调整大小?,javascript,jquery,css,highcharts,Javascript,Jquery,Css,Highcharts,调整图形区域或浏览器窗口的大小后,鼠标在highcharts中不会显示工具提示弹出窗口 $(function () { $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=large-dataset.json&callback=?', function (data) { // Create a timer var start = +new Date(); // Creat
$(function () {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=large-dataset.json&callback=?', function (data) {
// Create a timer
var start = +new Date();
// Create the chart
$('#container').highcharts('StockChart', {
chart: {
events: {
load: function () {
if (!window.isComparing) {
this.setTitle(null, {
text: 'Built chart in ' + (new Date() - start) + 'ms'
});
}
}
},
zoomType: 'x'
},
rangeSelector: {
buttons: [{
type: 'day',
count: 3,
text: '3d'
}, {
type: 'week',
count: 1,
text: '1w'
}, {
type: 'month',
count: 1,
text: '1m'
}, {
type: 'month',
count: 6,
text: '6m'
}, {
type: 'year',
count: 1,
text: '1y'
}, {
type: 'all',
text: 'All'
}],
selected: 3
},
yAxis: {
title: {
text: 'Temperature (°C)'
}
},
title: {
text: 'Hourly temperatures in Vik i Sogn, Norway, 2004-2010'
},
subtitle: {
text: 'Built chart in ...' // dummy text to reserve space for dynamic subtitle
},
series: [{
name: 'Temperature',
data: data,
pointStart: Date.UTC(2004, 3, 1),
pointInterval: 3600 * 1000,
tooltip: {
valueDecimals: 1,
valueSuffix: '°C'
}
}]
});
});
});
只需按如下所示的百分比指定图表容器宽度,或者在调整浏览器窗口或图表区域的大小时使用重画功能
<div id="chartcontainer" width='100%'></div>
更新图表演示链接
这是我们的bug追踪器上已经报告的bug。它应该在4.1.4/2.1.4版本中修复。是否尝试过调整大小时的chart.redraw或chart.reflow?这是奇怪的行为。祝你好运