获取工具提示的问题。 您只能在第一个点和最后一个点看到工具提示。
如何帮助输出图表上所有点的工具提示?
var options = {
chart: {
type: 'line',
renderTo: 'container',
zoomType: 'x'
},
xAxis: {
type: 'datetime'
},
tooltip: {
shared: true,
crosshairs: true,
xDateFormat: '<b>%H:%M</b>'
},
"series": [{
"name": "T",
"data": [[1365895320000, 26], [1365895020000, 26.0625], [1365894720000, 26.0625], [1365894420000, 26.0625], [1365894120000, 26.125], [1365893820000, 26.125], [1365893520000, 26.1875], [1365893220000, 26.1875], [1365892920000, 26.25], [1365892620000, 26.25], [1365892320000, 26.3125], [1365892020000, 26.3125], [1365891720000, 26.3125], [1365891420000, 26.375], [1365891120000, 26.375], [1365890820000, 26.375], [1365890520000, 26.4375], [1365890220000, 26.5], [1365889920000, 26.5625], [1365889620000, 26.5625], [1365889320000, 26.625], [1365889020000, 26.6875], [1365888720000, 26.6875], [1365888420000, 26.75], [1365888120000, 26.8125], [1365887820000, 26.875], [1365887520000, 26.9375], [1365887220000, 27.0625], [1365886920000, 27.125], [1365886620000, 27.1875], [1365886320000, 27.25], [1365886020000, 27.1875], [1365885720000, 27.25], [1365885420000, 27.25], [1365885120000, 27.25], [1365884820000, 27.25], [1365884520000, 27.25], [1365884220000, 27.3125], [1365883920000, 27.3125], [1365883620000, 27.3125] ]
}]
};
var chart = new Highcharts.Chart(options);
答案 0 :(得分:2)
Highcharts期望数据在X值上递增。
someData = [
[1365895320000, 26],
[1365895020000, 26.0625],
[1365894720000, 26.0625],
[1365894420000, 26.0625],
[1365894120000, 26.125],
[1365893820000, 26.125]
];
someData.sort();
请参见固定小提琴here。