chartjs-plugin-zoom icon indicating copy to clipboard operation
chartjs-plugin-zoom copied to clipboard

Is Chart.Zoom.js mobile-friendly?

Open m-oliv opened this issue 10 years ago • 7 comments

I want to use Chart.Zoom.js to zoom / pan Chart.js charts in mobile devices. Is this currently possible?

m-oliv avatar Sep 29 '16 14:09 m-oliv

@m-oliv yes this is touch friendly. Chart.Zoom.js depends on HammerJS. It has full touch support for panning and uses a pinch gesture to zoom.

etimberg avatar Sep 29 '16 14:09 etimberg

@etimberg Thanks for your prompt answer! I tried to use the zoom feature both on desktop and mobile. As far as I could tell, the zoom feature works in the desktop, but when I switch to mobile I cannot zoom in / zoom out using the pinch gesture. While experimenting, I noticed that your samples (included in the zip of your main repo) only work if I place the js files of HammerJS and ChartJS in a specific location: Chart.Zoom.js/node_modules/ Chart.Zoom.js/node_modules/

So, is Chart.Zoom.js "looking for" HammerJS in a set location (as above), or should it work as long as I import this library in the page that uses Chart.Zoom.js?

m-oliv avatar Sep 29 '16 15:09 m-oliv

It should work as long as hammerjs is included in the page

etimberg avatar Sep 29 '16 16:09 etimberg

@etimberg OK. Thanks! I'll look into my code again!

m-oliv avatar Sep 29 '16 16:09 m-oliv

I testes on my project and it works fine pan and zoom

LipSoft avatar Oct 04 '16 10:10 LipSoft

Its not working properly in mobile devices. Tested with ionic 2 project

rupalpatel0008 avatar Mar 08 '17 07:03 rupalpatel0008

Tip: Don't forget to FIRST include hammer BEFORE chart.js and zoom plugin:

    <script src="js/hammer.min.js"></script>
    <script src="js/chart.min.js"></script>
    <script src="js/chartjs-plugin-zoom.min.js"></script>

JannemanDev avatar Jul 13 '18 09:07 JannemanDev