1

I have a chartjs(wrapped by react-chartjs-2) line graph which is zoomable. The zoom functionality was enabled by using javascript library chartjs-plugin-zoom and passing the following configuration to chartjs.ChartOptions:

  pan: {
    enabled: true,
    mode: 'xy'
  },
  zoom: {
    enabled: true,
    mode: 'xy'
  }

On X axis I display the time and on Y axis some values related to my application. When I zoom or pan the chart the X axis min and max values change, here I need to obtain these values in order to perform a backend call(to update the chart) and also to synchronise it with another component in React.

Is there any possibility to obtain the new values for min and max upon a zoom or pan? I tried to look for a callback function which would provide this but found none so far.

Flowryn
  • 1,437
  • 1
  • 16
  • 32

0 Answers0