0

我有一个堆积柱形图,我试图在其中显示今天的进度。

x 轴显示日期,但格式错误。

http://jsfiddle.net/Mn6sB/7/

xAxis: {
    minTickInterval: 24 * 3600 * 1000,
    labels:Highcharts.dateFormat('%e %b',this.x),     
    categories: [Date.UTC(2013,8,8),Date.UTC(2013,8,9),Date.UTC(2013,8,10),Date.UTC(2013,8,11),Date.UTC(2013,8,12),Date.UTC(2013,8,13),Date.UTC(2013,8,14),Date.UTC(2013,8,15),Date.UTC(2013,8,16),Date.UTC(2013,8,17),Date.UTC(2013,8,18),Date.UTC(2013,8,19),Date.UTC(2013,8,20),Date.UTC(2013,8,21),Date.UTC(2013,8,22),Date.UTC(2013,8,23),Date.UTC(2013,8,24),Date.UTC(2013,8,25),Date.UTC(2013,8,26),Date.UTC(2013,8,27),Date.UTC(2013,8,28),Date.UTC(2013,8,29),Date.UTC(2013,8,30),Date.UTC(2013,9,1),Date.UTC(2013,9,2),Date.UTC(2013,9,3),Date.UTC(2013,9,4),Date.UTC(2013,9,5),Date.UTC(2013,9,6),Date.UTC(2013,9,7),Date.UTC(2013,9,8),Date.UTC(2013,9,9),Date.UTC(2013,9,10),Date.UTC(2013,9,11),Date.UTC(2013,9,12),Date.UTC(2013,9,13),Date.UTC(2013,9,14),Date.UTC(2013,9,15),Date.UTC(2013,9,16),Date.UTC(2013,9,17),Date.UTC(2013,9,18),Date.UTC(2013,9,19),Date.UTC(2013,9,20),Date.UTC(2013,9,21),Date.UTC(2013,9,22),Date.UTC(2013,9,23),Date.UTC(2013,9,24),Date.UTC(2013,9,25)]
}

我确信我错过了一些非常简单的东西。有人可以在这里帮助我吗?

谢谢美联社

4

1 回答 1

1

这是一种处理方法:

xAxis: {
    type: 'datetime',
    dateTimeLabelFormats: {
        day: '%e %b'
    }
}
....
series: [{
        name: 'Todays progress',
        data: [538,238,395,139,37,267,542,331,274,80],
        pointStart: Date.UTC(2013,9,16),
        pointInterval: 24 * 3600 * 1000 // one day
    },
    {
        name: 'Total till date',
        data: [13,551,789,1184,1323,1360,1627,2169,2500,2774],
        pointStart: Date.UTC(2013,9,16),
        pointInterval: 24 * 3600 * 1000 // one day
}]

这是您更新的 jsFiddle(使用较少的数据):http: //jsfiddle.net/Mn6sB/8/

于 2013-10-25T20:23:53.437 回答