1👍
I managed to solve the problem by taking another route. I created the charts in the html page file and then sent the data via AJAX. I suppose this method is actually much better.
- Chartjs-Limit numbers of labels on Chart.js in "smaller display only"
- Chartjs-How to add Chart.js to Wagtail Homepage panels using construct_homepage_panels hook?
Source:stackexchange.com