chartjs-plugin-zoom icon indicating copy to clipboard operation
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

Open MinhPhu1999 opened this issue 3 years ago • 1 comments

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.

MinhPhu1999 avatar Jun 18 '22 03:06 MinhPhu1999

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

LeeLenaleee avatar Jun 20 '22 09:06 LeeLenaleee