C3图重叠x轴标签

Shi*_*yar 6 javascript c3.js

C3图形重叠x轴标签,采用日期时间格式.我用Google搜索了这个查询,但没有得到任何解决方案.有可能c3只显示几个日期时间,而不是显示哪个结果重叠x轴标签在此输入图像描述

var data = {
    x: 'x',
    xFormat:'%Y-%m-%d/%H:%M',
    empty: {
        label: {
          text: "No Data"
        }
    },
    columns: [
        ['x', '{$dateArray}'],
        ['Attack', {$data}],
    ],colors: {
        Attack: '#67b7dc',
    },
    types: {
        Attack: 'area'
    }};
var chart = c3.generate({bindto: '#chart1',
size: {
    height: 630,
},
data: data,
grid: {
    x: {
        show: true
    },
    y: {
        show: true
    }
},
tooltip: {
    format: {
        value: function (value, ratio, id) {
            var format = value+' Gbps  [ IP: '+destIp[value]+' ]';
            return format;            
        }
    }
},
zoom: {
    enabled: true
},
subchart: {
    show: true
},axis: {
    x: {
        type: 'timeseries',
        tick: {
            format: '%b %d, %H:%M',
            rotate: 90,
            multiline: false
        }
    },
    y: {
        tick: {
            format: function (d) {
                return d.toFixed(3);
            }
        },
        label: {
            text: 'Attack Size ( Gbps )',
            position: 'outer-middle'
        }
    }
}
});
Run Code Online (Sandbox Code Playgroud)

Che*_*tan 5

使用 c3.js 图表配置 tick.count,将其设置为所需的整数值,如 2,3 或 4。

使用c3.js Timeseries Chart exmaple 来玩这个配置。

没有tick.count的问题:- 在此处输入图片说明

问题通过 tick.count 配置解决:- 在此处输入图片说明