简体   繁体   English

Highcharts时间序列,X轴最小值不起作用

[英]Highcharts timeseries, X-axis min not working

I have a timeseries graph using highchart in JSFddle that is supposed to show data spread out over an entire day and in a specific timezone. 我有一个在JSFddle使用highchart时间序列图,应该显示整天在特定时区分布的数据。 Thus the min value should be the start and the max value the end of the day in that timezone. 因此,最小值应为该时区中一天的开始时间,最大值应为一天的结束时间。

Somehow the data is not displayed when both min and max value are used. 同时使用最小值和最大值时,不显示数据。

xAxis: {
   min: min,
   max: max,
   type: 'datetime',
},

Once I remove the min value the data is displayed. 一旦删除最小值,便会显示数据。 What's wrong with the min value? 最小值有什么问题?

JSFiddle JSFiddle

Use valueOf() on moment.js dates to obtain timestamps for min/max values: moment.js日期上使用valueOf()以获得最小/最大值的时间戳:

xAxis: {
    // min/max must be timestamp
    min: min.valueOf(),
    max: max.valueOf(),
    type: 'datetime'
}

See jsfiddle updated: http://jsfiddle.net/beaver71/er4eLuaf/ 请参阅jsfiddle更新: http : //jsfiddle.net/beaver71/er4eLuaf/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM