What's going on here? Pan/zoom not working?
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
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.
@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.
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?
Has it been resolved? Is there any other plugin or example showing this zoom plugin working?
same problem for me...
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
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
try to chartjs-plugin-zoom in your app-module file it will fixes the issue