Switching between two datasets in this d3.js reusable and zoomable line chart

心已入冬 提交于 2019-12-07 23:00:01

问题


In this example http://bl.ocks.org/4743409 I set up a zoomable line chart containing two lines.

But Switching the selection options I obtain a superposition of the two datasets. How can I switch between the two?

Thank you in advance for your help and most of all for your suggestions to improve the code.

UPDATE: I succeeded in implementing a reusable chart (and I updated the example in the link). Now I have no superposition of the two datasets. However, I still do not understand why the proper svg dimesions are only setted on update and not on the first creation.

来源:https://stackoverflow.com/questions/14784109/switching-between-two-datasets-in-this-d3-js-reusable-and-zoomable-line-chart

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