AbelHeinsbroek / chartjs-plugin-crosshair

Crosshair plugin for ChartJS
https://chartjs-plugin-crosshair.netlify.com/samples/
MIT License
145 stars 87 forks source link

TypeError: Cannot read properties of undefined (reading `dragStarted`) #87

Open widjuu opened 2 years ago

widjuu commented 2 years ago

Hi, sometimes i see this error in my charts components. Trying to build 4 line charts and unite them by this plugin. Notised, when i use 3 charts, the error does not manifest, but if i add the fourth, something is going wrong and sometimes i`ve this error.

My react project using last versions of all librares: Chart.js 3.5.1, chartjs-plugin-crosshair: 1.2.0, react-chartjs-2: 3.1.0.

I've registered plugin by this way: import { Chart, Interaction } from 'chart.js'; import {CrosshairPlugin,Interpolate} from 'chartjs-plugin-crosshair'; Chart.register(CrosshairPlugin); Interaction.modes.interpolate = Interpolate

image

TimUnderhay commented 2 years ago

@widjuu see https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/issues/10

widjuu commented 2 years ago

@KensingtonTech thanks, hope this helps me