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

Time X axis zoom and pan does not work with chart.js 2.7.0

Open Denitz opened this issue 9 years ago • 8 comments

Denitz avatar Oct 11 '17 08:10 Denitz

I had the same thing, and some issues with 2.6.0, it seems to work with 2.5.0

f1code avatar Oct 12 '17 15:10 f1code

Same problem. So downgrading charts is the only solution?

blurry-code avatar Oct 13 '17 12:10 blurry-code

Here some more information about my case. I'm using this plugin in an ionicv1 app.

Here is the relevant part of my configuration:

      scales: {
        xAxes: [{
          type: 'time',
          ticks:{
            fontSize: 8
          },
          format: "HH:mm",
          unit: 'hour',
          unitStepSize: 2,
          time: {
            format: "HH:mm",
            unit: 'hour',
            unitStepSize: 2,
            displayFormats: {
              'minute': 'HH', 
              'hour': 'HH', 
            }
          }
        }]
      },zoom: {
          enabled: true,
          mode: 'x'
      },
      pan: {
          enabled: true,
          mode: 'x'
       }

I tried using mode 'xy' or 'y' the y-axis zoom works in both cases. However the x-zoom is not responding.

blurry-code avatar Oct 27 '17 14:10 blurry-code

same for me

sizilium avatar Oct 30 '17 13:10 sizilium

the problem is that scale.firstTick and scale.lastTick are not available in chart.js. You should replace it for scale.min and scale.max in the chartjs-plugin-zoom.js in the functions zoomTimeScale and panTimeScale. The zoom works fine, but the pan has a strange behavior, for me that is ok...

Cheers!

Vamoss avatar Oct 30 '17 18:10 Vamoss

@etimberg @simonbrunel Any change to look at the plugin repository? PRs are waiting since May, plugin does not work with recent chart.js

Denitz avatar Oct 31 '17 05:10 Denitz

Duplicate of https://github.com/chartjs/chartjs-plugin-zoom/issues/90. PR with fix pending

benmccann avatar Dec 28 '17 15:12 benmccann

PR with fix was merged

benmccann avatar Dec 29 '17 18:12 benmccann