'd3.js chart with a dynamic and overlapping Y axis

How can I show multiple time series overlapping each other with a dynamic Y axis that changes depending on which series is selected by the user.

The goal is to be able to compare patterns in the data, but it requires us to able able to display these charts overlapping on the Y axis.

Say TS1 (timeseries 1) has a dynamic range of [0 -> 2000] on the Y axis.
Say TS2 (timeseries 2) has a dynamic range of [500 -> 10,000] on the Y axis.

d3.js needs to be able to display both series on the graph overlapping (not stacking) on the Y axis.

Here is an example with pictures (Notice the change in Y Axis):

Green Series Selected:

Chart with Green Series Selected

Blue Series Selected: Chart with Blue Series Selected



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source