Closed diamond122 closed 4 years ago
I found the solution to update all y-axes when dragging.
When one of the zoom objects is updated, I need to update scale
and translate
for other zoom objects.
this.zoom.push(d3.behavior.zoom()
.x(this.xScale)
.y(this.yAxisList[tag].yScale) // when I replace [tag] with [0], then only first axis is being updated.
.scaleExtent([.5, 10])
.scale(this.currentZoom)
.translate(this.currentPan)
.on('zoom', () => {
// update other zoom object - COOL! ;)
this.zoom.forEach((zoom, t) => {
zoom.scale(this.zoom[tag].scale());
zoom.translate(this.zoom[tag].translate());
this.zoomed(t);
});
})
.on('zoomend', () => {
setTimeout(() => { this.zooming = false; }, 10);
}));
Hello, Friends. My chart has multiple Y-Axes that have different domains. When I am dragging on the chart, unfortunately only the last y-axis is being updated.
I added each y-axis like below;
Here is the zoom list for each axis.
And update them like below;
Structure of this chart:![image](https://user-images.githubusercontent.com/49306532/68946987-34cf6d80-07ac-11ea-84c7-de44319faad1.png)
How to update all Y-axes while dragging on the chart? Thanks in advance.