我怀疑这与分组有关,这里是图表选项对象。情节和系列增加了异步。我的旗帜系列有文字参数。任何想法,我可能会错过,或者这真的是一个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