如何在highcharts中显示datetime轴的所有值?

Rod*_*nho 6 highcharts

在这种情况下,有没有办法显示X轴的所有日子?即使我强迫minTickInterval到一天高图不显示所有的日子.

小提琴的例子

$(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]
    }]
});
Run Code Online (Sandbox Code Playgroud)

});

Eth*_* Wu 9

你需要的是xAxis中的tickInterval:

xAxis: {
    type: 'datetime',
    tickInterval: 1
}
Run Code Online (Sandbox Code Playgroud)

在这里更新了你的jsFiddle:http://jsfiddle.net/NR8vG/1/


Sli*_*eam 9

日期时间轴基于毫秒,因此一小时的间隔为:3600*1000.

上述解决方案在类型图表中不起作用:area.

因此,如果您的xAxis在几天内可以使用:

chart: {
    type: 'area'
},
xAxis: {
    type: 'datetime',
    tickInterval: 24 * 3600 * 1000
}
Run Code Online (Sandbox Code Playgroud)