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

What's going on here? Pan/zoom not working?

Open Techn1x opened this issue 9 years ago • 8 comments

Hi!

I'd really like to use this plugin but it just doesn't seem to work properly. Keeping in mind this issue https://github.com/chartjs/chartjs-plugin-zoom/issues/90 I've set up a codepen here using chartjs 2.5.0; https://codepen.io/anon/pen/PKdyNG

When I go to drag to zoom in, it doesn't zoom properly (I drag an area, and it doesn't zoom to that area if it zooms at all), and I can't pan at all. Is there something wrong with my chart or is it the plugin? Is there anything I can do?

Thanks

Techn1x avatar Aug 27 '17 07:08 Techn1x

Here the same fortunately i do not use x-axis but i was testing how it looks like but the same reaction i got as your example. I think it is a bug. Hopping they fix it soon.

AhmedBHameed avatar Aug 27 '17 20:08 AhmedBHameed

@Techn1x the issue here is that zoom and pan isn't supported for the default category x axis. Since you have numerical labels on the x axis, switching to a linear x axis will make it work.

etimberg avatar Aug 27 '17 21:08 etimberg

I see! However, I tried setting the xaxis to type: 'linear' and it just made my chart all funky. Tried a few things to fix it up but couldn't get it to appear the same as the graph is currently. Do you have any advice on what else I need to change to get the x axis to be linear and not completely broken?

Techn1x avatar Aug 27 '17 22:08 Techn1x

Has it been resolved? Is there any other plugin or example showing this zoom plugin working?

ankuradhey avatar Oct 05 '17 06:10 ankuradhey

same problem for me...

sizilium avatar Oct 30 '17 13:10 sizilium

Hey guys, with Chart.JS 2.7.1 out, I gave this addon another test. See my comment over here; https://github.com/chartjs/chartjs-plugin-zoom/issues/90#issuecomment-343379952

Essentially it works completely fine in my webapp (pan & zoom) but implementing in codepen seems to not work for some reason. Here's the codepen I made https://codepen.io/anon/pen/GOWRZB

Techn1x avatar Nov 10 '17 05:11 Techn1x

Closing this issue because; -The problem with the codepen is probably because the X axis uses categories -I've managed to get pan/zoom working in chartjs in my webapp -v0.6.0 of this plugin (and chart.js 2.7.1) has been published which fixes the issue I linked to https://github.com/chartjs/chartjs-plugin-zoom/issues/90

Techn1x avatar Jan 06 '18 07:01 Techn1x

try to chartjs-plugin-zoom in your app-module file it will fixes the issue

jaykumar1210 avatar Jun 20 '18 15:06 jaykumar1210