chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
586 stars 326 forks source link

Accept ratio of XY while zoom in mobile device horizontally or vertically #792

Open ghost opened 11 months ago

ghost commented 11 months ago

When I zoom in mobile device horizontally or vertically with my fingers, I expect the chart zoom in in both XY in same size, but the treemap chart zoom boxes in the x or y based on if I zoom horizontally or vertically. Zoom works fine if I zoom corner to corner, but not horizontally or vertically. I crate a jsfidlle example to show you the problem, but you need to test it in the mobile devices. https://jsfiddle.net/sohrabi2050/em406Lvt/3/ If there is a fix I appreciate if you can fix it in the jsFiddle or give me a way to fix it. I tested following ways but they don't help fixing the problem: 1- using diffrent mode: x, y , xy in options. 2- try reset zoom and zoom to the same level (it falls in an infinite loop)

Also you can see the example here in your mobile: http://ali.karmozd.com/index.html

There is another problem if you can please take a look at it: when I zoom in pc or mobile, the groups title(caption) also zooming but I expected their size don't change when I zoom in/zoom out.