【发布时间】:2017-12-12 10:57:37
【问题描述】:
为了解释我的问题,我在 c3js 网站 (http://c3js.org/samples/chart_bar.html) 上使用以下代码:
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 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({
unload : true,
columns: [
['data3', 130, -150, 200, 300, -200, 100]
]
});
}, 3000);
setTimeout(function () {
chart.load({
unload : true,
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 50]
],
});
}, 4000);
- 我点击data1隐藏了其中一个数据更新前,我有以下,这是正常的:
- 但是在最后一次更新之后,我得到了一个奇怪的行为,即 data1 “显示一半”:
有没有办法解决这个问题?
谢谢
【问题讨论】:
-
在这里分享你的代码,粘贴它
-
要重现问题,请使用我提供的代码进入网站,并在数据更新之前单击图例。
-
我无法重现您发送的问题,当我点击图例时,它表现正常
-
可能类似于github.com/c3js/c3/issues/2230,你用的是什么版本的c3?
标签: javascript d3.js c3.js