dc.js - Listening for chart group render

五迷三道 提交于 2019-11-26 17:44:00

The "right" way to do this is to register your chart in the dc registry with dc.registerChart

https://github.com/dc-js/dc.js/blob/master/src/core.js#L91

Unfortunately this stuff is not currently documented, but there is actually pretty light coupling here. You just need to implement .redraw() and .render() on some object (your chart or a wrapper), and pass it in as the first arg.

Put it in the same group (second arg) as the charts it should respond to.

render() creates the dom elements from scratch, and redraw() updates them when the data changes.

Looks like you may also need to implement a dummy .filterAll() but that's an oversight.

I added an issue to document this stuff:

https://github.com/dc-js/dc.js/issues/676

Please comment there or here if you run into trouble.

EDIT: this is now documented, thanks to Jasmine Hegman. See chartRegistry documentation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!