Use chart widget (standalone)

Hey! Is it possible to use the chart widget on my website without filament like the table builder?
9 Replies
ByteXR
ByteXR2y ago
Hi @divdax ! I believe it is coming in v3! Might be a plugin to do it now, but I am not sure ^^
DivDax
DivDaxOP2y ago
yes your right. in v3 the widget has its own package
Patrick Boivin
@divdax It's been a while so my memory could be wonky here but I remember being able to reuse a widget between the Admin and the front-end part of a site... A Widget is just a Livewire component in the end, so I think all that's needed is to also register the Livewire component for the rest of your app Something like: Livewire::register('my-frontend-widget', MyWidget::class) in a service provider then @livewire('my-frontend-widget')
DivDax
DivDaxOP2y ago
thank you @pboivin registered a chart component via serviceprovider Livewire::component('chart', TestChart::class); and can use it on my frontend. i just have to load chart.js in my frontend assets.
ssmusoke
ssmusoke16mo ago
@divdax How did you add the chart.js in your front-end assets? Did you find any way to load it automatically in Filament v2?
DivDax
DivDaxOP16mo ago
pulled in chart.js via cdn
ssmusoke
ssmusoke16mo ago
What version of Chart.js did you use?
DivDax
DivDaxOP16mo ago
just used the latest, i think v4. after that i pulled it in via npm so it gets served by my app.js
ssmusoke
ssmusoke16mo ago
Thanks, let me try the NPM route seems like the CDN is not working Found the issue my data was the one with breaking contentsw
Want results from more Discord servers?
Add your server