如何在单击时更改子气泡的颜色或在子气泡上添加悬停效果。 我尝试过这样的:
networkSeries.nodes.template.events.on('hit', e=> {
e.target.dataItem.color = e.target.dataItem.color.lighten(-0.2)
//networkSeries.deepInvalidate()
//networkSeries.invalidate()
})
但并不清爽。 这是示例代码:http://jsfiddle.net/gasnvf0j/
最佳答案
您应该将颜色分配给fill
或描边
才能看到结果:
const newColor = e.target.dataItem.color.lighten(-0.2)
e.target.dataItem.color = newColor
e.target.fill = newColor
关于javascript - 如何在 ForceDirectedTree amcharts 中的气泡上添加自定义事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55609966/