6

在这种情况下,有没有办法在 X 轴上显示所有日期?即使我将 minTickInterval 强制为一天,highcharts 也不会显示所有天。

小提琴示例

$(function () {
$('#container').highcharts({
    chart: {type: "column", inverted: true,
    },
    xAxis: {
        type: 'datetime'
    },

    plotOptions: {
        series: {
            pointInterval: 24 * 3600 * 1000,
            pointRange: 24 * 3600 * 1000
        }
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }, {
        data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
    }]
});

});

4

2 回答 2

10

日期时间轴以毫秒为单位,因此一小时的间隔为:3600 * 1000。

上述解决方案不适用于以下类型的图表:面积。

因此,如果您的 xAxis 以天为单位,您可以使用:

chart: {
    type: 'area'
},
xAxis: {
    type: 'datetime',
    tickInterval: 24 * 3600 * 1000
}
于 2014-07-29T16:01:00.993 回答
9

您需要的是xAxis 中的tickInterval

xAxis: {
    type: 'datetime',
    tickInterval: 1
}

在此处更新了您的 jsFiddle:http: //jsfiddle.net/NR8vG/1/

于 2013-11-12T20:10:16.430 回答