我懷疑這與分組有關,這裏是圖表選項對象。情節和系列增加了異步。我的旗幟系列有文字參數。任何想法,我可能會錯過,或者這真的是一個dataGrouping的人工製品?Highcharts股票圖表標誌tooltip not showing
更新:我今天我越來越發現「遺漏的類型錯誤:無法讀取屬性未定義‘周’」當我將鼠標懸停在標誌
chartOptions = {
chart: {
renderTo: 'chart',
backgroundColor:'rgba(255, 255, 255, 0.1)',
borderWidth: 0,
borderColor: "#FFFFFF",
defaultSeriesType: 'spline',
zoomType: 'x'
},
colors: [
'#666666',
'#AA4643',
'#4572A7'
],
rangeSelector: {
buttonSpacing: 5,
buttonTheme: {
style: {
padding: "0 3px"
},
width: null
},
selected: 2,
buttons: [
{
type: 'day',
count: 1,
text: 'Day'
},
{
type: 'month',
count: 1,
text: 'Month'
},
{
type: 'year',
count: 1,
text: 'Year'
},
{
type: 'all',
text: 'All'
}
]
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%e %b \'%y',
month: '%b \'%y',
year: '%b \'%y'
},
plotLines: []
},
yAxis: {
maxPadding: .05,
minPadding: .05,
title: {
text: 'Demand (kW)'
}
},
navigator: {
enabled: true
},
legend: {
enabled: true,
layout: 'horizontal',
align: 'center',
verticalAlign: 'top',
floating: true,
borderWidth: 0,
y: -5
},
plotOptions: {
series: {
dataGrouping: {
approximation: "average",
groupPixelWidth: 30,
smoothed: true,
unit: [
['minute', [1]],
['hour', [1]],
['day',[1]],
['week',[1]],
['month',[1]],
['year',null]
]
},
events: {
legendItemClick: function(event) {
return !(this.name == 'Baseline');
}
},
connectNulls: false,
marker: {
enabled: false,
states: {
hover: {
enabled: false
}
}
}
},
flags: {
showInLegend: false,
style: {
borderColor: '#cc0000',
color: '#cc0000'
}
}
},
series: []
};
感謝您的回覆。我的數據按x升序排序(甚至添加了一個ksort來確保),但我仍然沒有得到關於標誌的工具提示 – 2013-03-18 14:55:38
你能否粘貼你的部分數據? – 2013-03-18 14:56:52
我的數據是幾個系列的8760分(每小時一年)。儘管我已經解決了這個問題,請參閱下面的答案。謝謝! – 2013-03-18 18:35:17