[Chartjs]-Get access to the chart.js component instance in React

5👍

according to this issue in the wrapper you can put a ref on the bar component and that is the chart instance https://github.com/reactchartjs/react-chartjs-2/issues/3

<div className={classes.chartContainer}>
          <Line
            ref={myChartRef}
            data={chartData}
            options={options}
          />
        </div>

 const myChartRef = React.createRef();
  const handleResetZoom = () => {
    let chart = myChartRef.current.chartInstance;
    chart.resetZoom();
  };

Leave a comment