You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using [email protected] and [email protected], an error is generated "Cannot read properties of undefined (reading 'left') on clipArea" when the resizeDelay option is set to non-zero.
JSFiddle: here (or just copy and paste this into a new fiddle)
My guess at a possible solution could be to only draw if ctx and chartArea are defined?
alternatively, it may be one for the maintainers of chartJS to fix for all users of plugin helprs. It only seems to affect chartjs-plugin-annotation however, not other plugins we're currently using such as chartjs-plugin-zoom
The text was updated successfully, but these errors were encountered:
@edwardmjackson thank you for issue. I have tried your code both in JSFiddle and Codepen but I don't have any issue, both enabling and disabling resizeDelay.
You can see my codepen https://codepen.io/stockinail/pen/YzdELbx.
Anyway I see that the box annotation looks like to be configured in the wrong place, in chart options. The annotation plugin options must be located in the "plugins" node of chart options.
If I have done something wrong for reproducing your issue, let me know.
This is very curious. I reproduced at work, which is using Chrome. At home, Firefox (at least v 117.0.1) doesn't have the same issue though. The Chrome build is Version 116.0.5845.188 (64-bit) on Windows.
Hopefully this ScreenToGif works to show what I'm seeing.
uhmm... It's really weird. I have tried with Chrome Version 117.0.5938.88 (Official Build) (and before with FF 117.0.1) and no issue doing the same things you showed me in the img.
Let me take time (I'm very busy on other stuff in this period) to try reproducing the issue.
Using
[email protected]
and[email protected]
, an error is generated "Cannot read properties of undefined (reading 'left') on clipArea" when theresizeDelay
option is set to non-zero.JSFiddle: here (or just copy and paste this into a new fiddle)
If you comment and uncomment line 28,
resizeDelay: 100
, the JSFiddle shows "script error" appear when resizeDelay is set.The error appears to be in the Draw function
chartjs-plugin-annotation/src/annotation.js
Lines 151 to 167 in 193e4ce
Where
clipArea(ctx, chartArea)
is called butchartArea
is not yet defined, hence the chart.js helper athttps://github.com/chartjs/Chart.js/blob/master/src/helpers/helpers.canvas.ts#L327
fails.
My guess at a possible solution could be to only draw if ctx and chartArea are defined?
alternatively, it may be one for the maintainers of chartJS to fix for all users of plugin helprs. It only seems to affect chartjs-plugin-annotation however, not other plugins we're currently using such as chartjs-plugin-zoom
The text was updated successfully, but these errors were encountered: