C3 图重叠 x-axis 标签
C3 graph overlapping x-axis label
C3 图表与日期时间格式的 x-axis 标签重叠。我用谷歌搜索了这个查询,但没有得到 it.Is 的任何解决方案 c3 可能只显示几个日期时间而不是完全显示,这导致重叠 x-axis 标签
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'
}
}
}
});
使用 c3.js 图表配置 tick.count,将其设置为所需的整数值,如 2,3 或 4。
使用 c3.js Timeseries Chart exmaple 玩这个配置。
没有问题 tick.count:-
问题已通过 tick.count 配置解决:-
C3 图表与日期时间格式的 x-axis 标签重叠。我用谷歌搜索了这个查询,但没有得到 it.Is 的任何解决方案 c3 可能只显示几个日期时间而不是完全显示,这导致重叠 x-axis 标签
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'
}
}
}
});
使用 c3.js 图表配置 tick.count,将其设置为所需的整数值,如 2,3 或 4。
使用 c3.js Timeseries Chart exmaple 玩这个配置。
没有问题 tick.count:-
问题已通过 tick.count 配置解决:-