【发布时间】:2016-01-21 10:08:04
【问题描述】:
我们以下面的图表http://c3js.org/samples/chart_bar.html为例 但将列数据替换为以下数据:
var chart = c3.generate({
data: {
columns: [
['data1', 30, 0, 100, 0, 150, 250],
['data2', 130, 0, 140, 200, 0, 50]
],
type: 'bar'
},
bar: {
width: {
ratio: 0.5 // this makes bar width 50% of length between ticks
}
// or
//width: 100 // this makes bar width 100px
}
});
setTimeout(function () {
chart.load({
columns: [
['data3', 130, -150, 200, 300, -200, 100]
]
});
}, 1000);
正如我们所见,我们有很多空白或零值条,我们如何删除它并删除空白。 (不隐藏,我知道怎么用 CSS 隐藏)
【问题讨论】:
标签: c3.js