Skip to content

Commit

Permalink
Cannot pan on y-axis when zoomed and rotated=true #2799 (#2805)
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Giuliano <marco.giuliano@tesisquare.com>
  • Loading branch information
digEmAll and Marco Giuliano authored Aug 8, 2020
1 parent bae5d5c commit 062a185
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ ChartInternal.prototype.initZoom = function() {

$$.zoom.updateDomain = function() {
if (d3.event && d3.event.transform) {
$$.x.domain(d3.event.transform.rescaleX($$.subX).domain())
if (config.axis_rotated && config.zoom_type === 'scroll' && d3.event.sourceEvent.type === 'mousemove') {
// we're moving the mouse in a rotated chart with zoom = "scroll", so we need rescaleY (i.e. vertical)
$$.x.domain(d3.event.transform.rescaleY($$.subX).domain());
} else {
$$.x.domain(d3.event.transform.rescaleX($$.subX).domain());
}
}
return this
}
Expand Down

0 comments on commit 062a185

Please sign in to comment.