我正在使用Highcharts/Highstock来绘制相当大量的数据(~10,000点).数据由X轴上的Date对象和Y上的浮点组成,格式如下:[[(date), 1.728], [(date), 0.346], ...]
.日期总是相隔1小时,数据中没有间隙.
当图表的范围> = 21天(这样至少可以显示21天的数据)时,图表会正确显示.但是,只要范围小于该范围,图表就会变为空白,工具提示会将每个点显示为Y值为0.0.这些点的Y值确实存在于数组中(我可以在Firebug中看到它们),但它们不会显示在图表上.这是我如何初始化它:
mainChart = new Highcharts.StockChart({
chart: {
renderTo: 'linegraph'
},
rangeSelector: {
buttons: [{
type: 'day',
count: 1,
text: '1 d'
}, {
type: 'week',
count: 1,
text: '1 wk'
}, {
type: 'month',
count: 1,
text: '1 mo'
}, {
type: 'year',
count: 1,
text: '1 yr'
}, {
type: 'all',
text: 'All'
}],
selected: 2
},
series: [{
name: 'Electricity usage (kWh)',
data: graphData,
tooltip: {
valueDecimals: …
Run Code Online (Sandbox Code Playgroud)