Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pan doesn't work without `zoom.enabled` #132

Closed
danilvalov opened this issue Mar 28, 2018 · 5 comments
Labels
bug

Comments

@danilvalov
Copy link

@danilvalov danilvalov commented Mar 28, 2018

I need a panning only (without zooming).
But if I disable zoom (zoom: {enabled: false}), pan doesn't work.

If I remove the following lines:

if (!options.zoom || !options.zoom.enabled) {
return;
}

and add checking if (options.zoom && options.zoom.drag) { instead the following line:
if (options.zoom.drag) {

then pan works without zoom.

Why did you disable pan without zoom? Which problems did you have?

@Mrostgaard

This comment has been minimized.

Copy link

@Mrostgaard Mrostgaard commented Apr 30, 2018

This should get a bug tag. I had so much problem with this!

axelchalon added a commit to axelchalon/chartjs-plugin-zoom that referenced this issue Jun 28, 2018
@cabal95

This comment has been minimized.

Copy link

@cabal95 cabal95 commented Jul 14, 2018

As a temporary work around, I set my options like this and it seems to work:

zoom: {
    enabled: true,
    mode: ''
}
@glukki

This comment has been minimized.

Copy link

@glukki glukki commented Nov 27, 2018

@cabal95 this works, thank you! but still prevents page scroll, when mouse is over chart :(
@axelchalon are you going to make a PR?

@axelchalon

This comment has been minimized.

Copy link

@axelchalon axelchalon commented Nov 28, 2018

don't think so, had the same issue and I don't know what the rationale was behind that line of code

@linzhoulxyz

This comment has been minimized.

Copy link

@linzhoulxyz linzhoulxyz commented Feb 22, 2019

As a temporary work around, I set my options like this and it seems to work:

zoom: {
    enabled: true,
    mode: ''
}
zoom: {
  enabled: true,
  drag: true,  
 }

look into source code, this will work fine, and page can scroll too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
7 participants
You can’t perform that action at this time.