我在使用 C3.js 关闭动画时遇到了一些问题。当鼠标悬停在 C3.js 圆环图上时是否可以删除动画?
我将持续时间设置为 0,但它不起作用 - 当鼠标悬停在图表上时,仍会制作动画。
示例:https://jsfiddle.net/4ff8vnx4/1/
这是我的代码:
var chartDonut1 = c3.generate({
bindto: "#chart1",
data: {
type: 'donut',
json: [
{"Parfait": 190},
{"Bien": 120},
{"Trop court": 32},
{"Trop long": 22}
],
keys: {
value: ['Parfait', 'Bien', 'Trop court', 'Trop long']
},
names: {
'Parfait': 'Parfait (entre 50 \340 60 car.)',
'Bien': 'Bien (entre 40 \340 49 ou 61 \340 69 car.)',
'Trop court': 'Trop court (inf\351rieur \340 40 car.)',
'Trop long': 'Trop long (sup\351rieur \340 79 car.)'
}
},
transition: {duration: 0}
});
最佳答案
你应该看看 reference guide C3.js 的。你想要的是禁用交互。您可以通过将以下代码片段添加到配置对象来实现此目的。
interaction: {
enabled: false
}
关于javascript - 不要在 C3.js 圆环图上显示动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35799078/