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

Panning does not work with draggable-date plugin #308

Closed
Zuckerbrot opened this issue Dec 26, 2019 · 3 comments · Fixed by #382
Closed

Panning does not work with draggable-date plugin #308

Zuckerbrot opened this issue Dec 26, 2019 · 3 comments · Fixed by #382

Comments

@Zuckerbrot
Copy link

I am using chart.js with the draggable data plugin
https://github.com/chrispahm/chartjs-plugin-dragdata

I would also like to use the panning functionality of the zoom-plugin.

However,I can only get either panning or data-dragging to work.
Example (works in Safari):
https://jsfiddle.net/zpq8an40/1/

This seems to be related to the fact that both panning and dragging use the same mouse gesture.

Would be nice to have both, like eg here
http://bl.ocks.org/stepheneb/1182434.

Would it be possible to allow the definition of a panKey, like {shift, ctrl, alt}, which, if pressed, toggles either the data-dragging or panning functionality?
This approach is used with highcharts to allow for both functionalities, cf. https://api.highcharts.com/highcharts/chart.panKey

Thanks very much and happy holidays!

@benmccann
Copy link
Collaborator

I would be open to a pull request to add this functionality. I don't have time to add it myself

@jledentu
Copy link
Collaborator

@Zuckerbrot Good idea. I'd suggest to call this new property modifierKey.

plugins: {
	zoom: {
		pan: {
			enabled: true,
                        modifierKey: 'alt'
                },
                zoom: {
			enabled: true,
                        modifierKey: 'alt'
                }
        }
}

@etimberg
Copy link
Member

Looks like this got merged

@etimberg etimberg linked a pull request Apr 25, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants