Hi,
Hope someone can help :)
Using v3 I linked 2 charts with a single zoom behaviour, with no issues - I could drag and zoom happily. However on update to v4 I can't for the life of me get it working as it used to. (probably missing something obvious...!)
The issue seems to be with using d3.event.transform on the transform attribute. If I use mouse to zoom / drag in e.g chart1, chart2 does zoom / drag in sync, however, if I then cross to chart2 and zoom / drag, both charts "reset" to what chart2 was previously.
Below is an example of the code I use.
And I created a fiddle which hopefully explains the issue.
Cheers!
var zoom = d3.zoom().scaleExtent([.5, 10]);
var svg = d3.selectAll('svg'); // 2 charts
var layers = svg.selectAll('g.layer');
function zoomed() {
layers.attr('transform', d3.event.transform);
}
svg.call(zoom);
zoom.on('zoom', zoomed);