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 & zoom not working for x-axis #8

Closed
Intelli32 opened this issue Jun 1, 2016 · 20 comments
Closed

Pan & zoom not working for x-axis #8

Intelli32 opened this issue Jun 1, 2016 · 20 comments

Comments

@Intelli32
Copy link

Intelli32 commented Jun 1, 2016

Hi, I am trying to get pan & zoom working but I am not able to do that on X-axis even though I have the following settings. The provided examples works fine and I am trying to mimic those.

pan: { enabled: true, mode: 'xy' limits: { max: 10, min: 0.5 } },

zoom: { enabled: true, mode: 'xy' limits: { max: 10, min: 0.5 } },

What are the common mistakes when this happens?
Fiddle: https://jsfiddle.net/jm1adysp/3/

@etimberg
Copy link
Member

etimberg commented Jun 1, 2016

@Intelli32 can you post a fiddle?

@Intelli32
Copy link
Author

Sorry, I thought I would have time to add a fiddle but you replied so fast :) Updated my post

@etimberg
Copy link
Member

etimberg commented Jun 1, 2016

Awesome, thanks. To get this working, I need to implement panning and zooming for the category scale. Right now only numerical scales are supported

@Intelli32
Copy link
Author

Intelli32 commented Jun 1, 2016

Ok, but I get the same result even if I change labels to [1, 2, 3, 4, 5, 6]. But maybe this was not what you meant with "numerical scale"?

@etimberg
Copy link
Member

etimberg commented Jun 1, 2016

I meant using a linear, logarithmic, or time type of scale for the x axis.

@Intelli32
Copy link
Author

My intention was actually to use a time scale so I got it working with that now. Thanks for the quick response!

@etimberg
Copy link
Member

etimberg commented Jun 1, 2016

👍

@beefo
Copy link

beefo commented Aug 11, 2016

@etimberg I'm having a similar issue with panning using "time" scale x axis. I created a plunker here with an example.

@beefo
Copy link

beefo commented Sep 2, 2016

@etimberg Is sample I provided adequate? Were you able to reproduce?

@etimberg
Copy link
Member

etimberg commented Sep 2, 2016

@beefo just had a look now. I think you need to include hammerjs to make this work

@beefo
Copy link

beefo commented Sep 6, 2016

Ah, yes, thank you @etimberg. Worked like a charm.

@quique1233
Copy link

@etimberg

Awesome, thanks. To get this working, I need to implement panning and zooming for the category scale. Right now only numerical scales are supported

Any new about this?

@Koshux
Copy link

Koshux commented May 8, 2017

@etimberg
I also am finding weird behaviour in the following codepen:
http://codepen.io/anon/pen/VbyZpL

This was the initial codepen I had found however tried addressing the solutions mentioned across the issues in this GitHub page however I still could not get it to work.

The bug/unwanted behaviour I find is that it appears that panning occurs on the opposite side of where the mouse pointer coordinates exist. Meaning if I place my cursor on the left-most side of the chart, it pans to the right-most side, whereas if I place my cursor on the right-most side of the chart, it pans to the left-most side of the chart.

@RPHolloway
Copy link

@Koshux I am seeing the same issue, and it seems to zoom in, to only show the graph region between two points. I was expecting it to work like panning in the y direction (which works great!).

Did you ever find an answer to this problem?

@Koshux
Copy link

Koshux commented May 30, 2017

@RPHolloway I have not yet found a solution for it unfortunately. Further progress is impeded due to #73 .

@adeel3612
Copy link

anyone find the solution for panning on the x-axis.?

@adeel3612
Copy link

@RPHolloway @Koshux guys any thing you got for the category scale? any hack or idea ?

mcelotti added a commit to mcelotti/chartjs-plugin-zoom that referenced this issue Mar 20, 2018
@mcelotti
Copy link

Hi @adeel3612 I was having the same problem, take e a look at #109

mcelotti added a commit to mcelotti/chartjs-plugin-zoom that referenced this issue Mar 22, 2018
mcelotti added a commit to mcelotti/chartjs-plugin-zoom that referenced this issue Mar 22, 2018
mcelotti added a commit to mcelotti/chartjs-plugin-zoom that referenced this issue Mar 22, 2018
@JamesMcMahon
Copy link

Awesome, thanks. To get this working, I need to implement panning and zooming for the category scale. Right now only numerical scales are supported

Is this statement still true?

@kurkle
Copy link
Member

kurkle commented Mar 8, 2021

Its been implemented years ago, closing.

@kurkle kurkle closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests