1
我有多個系列的Highchart,我想在固定的位置顯示工具提示。我根據這documentation跟着這個highcharts demo。不幸的是,根據我編寫的配置代碼,工具提示沒有顯示在固定位置。如何在多系列高圖中顯示固定的工具提示位置?
該圖表的crosshair
設置爲true
,並在沿x軸移動鼠標時顯示y軸點(下面的截圖)。
在上面的截圖,我想顯示工具提示CDT158:188.84和CDEP158:151.00綠色框(左上固定位置)。
這是我的示例配置代碼
function plotChartData(dataSeries, xaxisTitle)
{
myChart = new Highcharts.Chart({
chart: {
renderTo: 'chartSpace',
type: 'line',
zoomType: 'xy',
panning: true,
panKey: 'shift',
plotBorderWidth: 1,
events: {
dblclick: function (e) {
window.alert('Hello Chart!')
}
}
},
title: {
text: 'Fixed Tooltip'
},
legend: {
layout: 'horizontal',
align: 'left',
itemDistance: 10,
borderWidth: 0,
itemMarginTop: 0,
itemMarginBottom: 0,
padding: 20
},
plotOptions: {
series: {
states: {
hover: {
enabled: false
}
},
dataLabels: {
enabled: false,
format: '{y}'
},
allowPointSelect: false
}
},
xAxis: {
type: 'datetime',
labels: {
rotation: -65,
style: {
fontSize: '9px',
fontFamily: 'Verdana, sans-serif'
}
},
crosshair: true
},
yAxis: {
gridLineColor: '#DDDDDD',
gridLineWidth: 0.5
},
tooltip: {
positioner: function() {
return { x: 80, y: 10 };
},
pointFormat: '{series.name}: <b>{point.y}</b><br/>',
split: true,
valueDecimals: 2,
shadow: false,
borderWidth: 0,
backgroundColor: 'rgba(255,255,255,0.8)'
},
series: [{
name: xaxisTitle,
data: dataSeries
}]
});
}
我似乎無法找到任何解決方案在那裏,類似於我的要求。我查看了Highcharts API文檔,但是我很困惑要使用哪個屬性或對象。
任何幫助,非常感謝。
感謝您的回答。所以,這就是'shared'屬性的用法。你節省了我的一天。 – Juniuz