Jordy
Export ChartWidget to image
this might be the worst code I've ever written, but I ended up building the chart in a livewire component, and then sending the image to the backend inside a script tag
Issues I encountered:
image would be empty if I didnt disable animations or set a timeout (this sucks, so i disabled entirely)https://www.chartjs.org/docs/latest/configuration/animations.html
Had quite some issues getting chartjs to work (I needed it outside of the filament panel aswell, so I ended up using this package which works pretty well. If you give the charts a unique name you can easily fetch them with JS using their name.
https://icehouse-ventures.github.io/laravel-chartjs/
3 replies