0

当使用堆叠柱形图和 xAxis 类型是 yAxis 上的 datetime 很多日期时,尽管只发送了 2 个日期。

http://jsfiddle.net/jBxbe/

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            type: 'datetime',
        },
        yAxis: {
        },
        plotOptions: {
            column: {
                stacking: 'normal',
                minPointLength: 3
            }
        },
            series: [{
            name: 'Ex1',
            data: [[1367280000000,8],[1369872000000,26349]]
        }, {
            name: 'Ex2',
            data: [[1367280000000,19196],[1369872000000,31213]]
        },]
    });
});
4

2 回答 2

0

可以使用pointRange参数http://api.highcharts.com/highcharts#plotOptions.column.pointRange/tickInterval(http://api.highcharts.com/highcharts#xAxis.tickInterval 两类http ://api.highcharts .com/highcharts#xAxis.categories

于 2013-06-24T14:06:08.737 回答
0

有了这么少的数据量,您最好使用categoryxaxis 而不是日期时间。这将使您更好地控制显示器。

 $(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            categories: ['Apr 2013','May 2013']                
        },
        yAxis: {
        },
        plotOptions: {
            column: {
                stacking: 'normal',
                minPointLength: 3
            }
        },
            series: [{
            name: 'Ex1',
            data: [8,26349]
        }, {
            name: 'Ex2',
            data: [19196,31213]
        },]
    });
});

在这里拉小提琴。

于 2013-06-24T13:44:54.800 回答