0

如何调整条形图中的轴,以便每个季度的第一个月将显示为给定时间间隔的轴点。

例如:- 如果开始年份是 2012 年,结束年份是 2013 年,则轴应显示为

jan 2012, apr 2012, jul 2012, Oct 2012 , jan 2013, apr 2013, jul 2013, Oct 2013

演示链接

4

2 回答 2

1
yAxis:  {      
 type: 'datetime',
 min: Date.UTC(2012,0,1),
 title: {text: ''},
 tickInterval: 24 * 3600 * 1000 *30 * 4,
 labels: {
 formatter: function() {
  var d= new Date(this.value);
  var month = d.getMonth();
  var monArr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
  return monArr[month] + " - " + d.getFullYear();
  }
}               
于 2013-01-16T07:01:58.170 回答
0

Instead of arrays, you can set tickInterval and in formatter use Highcharts.dateFormat();

https://api.highcharts.com/highcharts/data.dateFormat

于 2013-02-01T12:57:30.310 回答