有一个可靠的方法来使用高图表有一个月的自动生成的时间间隔? [英] Is there a reliable way to have a 1 month auto generated tick interval with high charts?
问题描述
推荐的方法是使用等于31天的时间间隔,但是有许多2月会跳过的用例。
有一个可靠的方法可以让一个月的自动生成的时间间隔与高图表一起进行吗?
看起来像不规则区间数据提供的例子可以解决您的问题: Highcharts演示 - 不规则时间间隔
从这个例子中,用于x轴标签的相关代码是:
xAxis:{
type:' datetime',
dateTimeLabelFormats:{//不显示虚拟年份
month:'%e。 %b',
year:'%b'
}
},
High charts has a really nice way to generate dates for charts.
However since you need to specify a tickInterval to use generate the dates for each point, doing 1 month intervals is very difficult since they are irregular.
The recommended approach is to use a tick interval equal to 31 days, but there are a number of use cases where February gets skipped.
Is there a reliable way to have a 1 month auto generated tick interval with high charts ?
Seems like the example provided for irregular interval data would solve your problem: Highcharts Demo - Irregular Time Interval
The relevant code, from that example, for x-axis labeling is:
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%e. %b',
year: '%b'
}
},
这篇关于有一个可靠的方法来使用高图表有一个月的自动生成的时间间隔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!