highchart股票:图表消失时,包含周末数据点
问题描述:
最近我遇到了一个非常奇怪的问题,当使用highchart股票(highstock.js)。我加载了一些包含星期六数据点的数据点。当应用程序运行时,看起来像这样: highchart股票:图表消失时,包含周末数据点
没有图形出现,只有导航器和时间轴标签。然而,当我拖到导航到全尺寸的图形出现,但x轴时间标签消失,它看起来像这样:
我已经建立了这里plunker:graph disappear when met weekend data point link
一些主配置代码如下:
scrollbar : {
barBackgroundColor : 'gray',
barBorderRadius : 7,
barBorderWidth : 0,
buttonBackgroundColor : 'gray',
buttonBorderWidth : 0,
buttonArrowColor : 'yellow',
buttonBorderRadius : 7,
rifleColor : 'yellow',
trackBackgroundColor : 'white',
trackBorderWidth : 1,
trackBorderColor : 'silver',
trackBorderRadius : 7,
// enabled: false,
liveRedraw : false
},
navigator : {
xAxis : {
labels : {
formatter : function(e) {
console.log("value : " + this.value);
console.log("value :" + typeof this.value)
return Highcharts.dateFormat('%Y-%m-%d', this.value);
}
}
},
handles : {
backgroundColor : '#808080'
},
//margin : -10
},
xAxis : {
type : 'datetime',
tickLength : 0
},
谁能告诉我为什么?
答
我找到了真正的原因。这不是因为周末的数据点,而是因为数据未按时间升序排序。