对于Highcharts,有没有一种在x轴上获取日期的标准方法?在他们的文档中找不到:https://api.highcharts.com/highcharts/xAxis.type
当我的时间范围足够大时,它会显示日期。但是,当时间范围不够大时,它只显示小时,如下所示:
这不太理想..。如果它能在这种情况下显示日期和时间,那就太好了。有人知道怎么做吗?
发布于 2011-08-18 12:10:00
从Highcharts API查看此sample。
替换这个
return Highcharts.dateFormat('%a %d %b', this.value);
有了这个
return Highcharts.dateFormat('%a %d %b %H:%M:%S', this.value);
查看有关dateFormat()
函数的here。
另请参阅- tickInterval和pointInterval
发布于 2016-08-25 16:43:19
您可以这样写:
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%d %b %Y' //ex- 01 Jan 2016
}
}
还要检查其他日期时间格式
http://api.highcharts.com/highcharts#xAxis.dateTimeLabelFormats
https://stackoverflow.com/questions/7101464
复制相似问题