0
我只想顯示'data1'數據。爲此,我正在做一個超時。但在它仍然顯示'data2'的值後。我該如何解決這個問題?更新c3.js中條形圖的數據
https://jsfiddle.net/1q5zyftL/
var data1=[['data1', 35, 205, 150, 100, 100, 200], ['data2', 130, 120, 130, 190, 100, 40]];
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 50]
],
type: 'bar',
labels:true
},
type: 'bar',
bar: {
width: {
ratio: 0.5 // this makes bar width 50% of length between ticks
}
},
axis: {
rotated: true
}
});
setTimeout(function() {
chart.load({
columns: [
data1[0]
]
});
}, 1000);