C3图表最大X值(类别)

时间:2017-05-24 15:59:11

标签: javascript html5 charts c3.js

我需要在X轴上显示更多类别,这应该是从早上6点到晚上11点的条目,但它只显示从早上6点到晚上10点。有没有办法显示更多我已尝试改变图形大小的值,但没有。有没有办法做到这一点或有限?

        var chart_loaded = c3.generate({
        bindto: '#chart_loaded',
    data: {
        columns: [
            loaded_orders,
            loaded_pieces
        ],
        axes: {
            Orders: 'y',
            Pieces: 'y2'
        },
        type: 'bar',
        types: {
            Pieces: 'line'
        }
    },
    axis : {
    x : {
        type : 'category',
        categories: ['6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm',
              '8pm', '9pm', '10pm', '11pm', '12am'],
        fit: false
    },
    y: {
        padding: {top: 200, bottom: 0}
    },
    y2: {
        padding: {top: 200, bottom: 0},
        show: true
    }
},
regions: [
    {axis: 'y', start: 0, end: 18, class: 'regionY'}
]
});

这是我的输出: enter image description here

0 个答案:

没有答案