chartjs-plugin-zoom
chartjs-plugin-zoom copied to clipboard
Cannot pan and zoom in mode 'x' with chart.js v2.9.3, react-chartjs-2 v2.9.0, hammerjs 2.0.8, chartjs-plugin-zoom v0.7.7
This is my import
import { Line, Bar } from 'react-chartjs-2';
import 'chartjs-plugin-zoom';
import 'hammerjs;
And this is my config for options
` options:
options:{
plugins:{
zoom: {
pan: {
enabled: true,
mode: 'x',
modifierKey: 'ctrl',
},
zoom: {
enabled: true,
drag: {
enabled: true
},
mode: 'x',
},
}
}
`
It works with mode "xy" and "y" but not work mode "x". Please help me solve this issue.
It seems to work but verry buggy and inconsistent, if you upgrade to Chart.js V3 and V1 of the zoom plugin it works fine: https://www.chartjs.org/chartjs-plugin-zoom/latest/samples/drag/category.html