Closed AmineId closed 5 months ago
Hi @AmineId when I try to access window.Chart it works perfectly fine. Can you add a reproducable example as stateted in the issue template as being required?
Hi @LeeLenaleee, sorry for not being able to provide a template, since I'm working in Salesforce :/
For my case, I was able to get it to work, since I'm in Shadow DOM with an extra layer of security (Salesforce by default locked all LWC -component created for web like in Angular or Vue- from being visible to Third-Party Plugins), I just disabled the Lock features and I could use chartJs normally. But this only because I did have the option to do that (only when creating website to be used by Customer - it's some sort of cloud in Salesforce EcoSystem)
I need to do some tests to validate my theory, but for an Experience Cloud (a tag for any Salesforce developer with the issue) usage this is the work around :)
Thanks a lot for the reply, I'll keep you posted :D, for now I'll close the issue
Expected behavior
Previously with ChartJS v2, we could call the constructor Chart from window, since we override the loading of the framework.
Current behavior
I wanted to use ChartJs v4 on a new project, but the window.Chart is not resolved.
Reproducible sample
https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js
Optional extra steps/info to reproduce
No response
Possible solution
I tried running a new recompile to add the binding with window, but the projet has evolved soo much I was lost :D
Is there a way (fast way) to do the binding with window ?
Context
No response
chart.js version
v4.4.1
Browser name and version
No response
Link to your project
No response