问题
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