How to make widget chart to be live update also
I have this widget and have a chart, but when I updated it only the upper content is being updated via live updated, the chart stays the same
24 Replies
as you can see, my chart should be color yellow and straight line but only the
counter and label has changed.
The canvas contains wire:ignore. I think that it isn't possible
Already ask on chat
maybe im just wasting my time looking for answer.
thanks anyways.
I think it has something to do with this error.
filament devs ignores it,This is not a great attitude... everyone is busy with their own thing, the help you get here is voluntary.
yeah, I take that back, just frustrated working 15hrs straight, mybad.
No worries 👍
I'm just catching up with the question... are you close to having a solution here?
hello, not yet, im currently handling the error where it returns division by zero.
im kinda understand the error on console since I used to have that on native php but I have no idea how to resolve that on filament.
Does the error happen when the page loads or only when you try to refresh the chart?
only when I update the data/chart
Yeah, like Leandro said, the
wire:ignore
is probably the issue... looks like the chart is not designed to be reloaded like that.
I wonder if there's a chart.js event you could trigger...yeah which makes me endup not resolving it, its kinda deep for me dont have any idea when it comes into that just to resolve.
ill ignore it for now.
thanks for your help!
Ok, you're welcome. I'll let you know if I think of something.
I agree
hey @chrysippus2497
Maybe we have an issue here as you said.. I'm trying this
I'm srry bout that.
Hmm, any way to like resolve it? way back on native php I used to increment the id of my canvas for it just to be unique everytime ajax calls a request.
but i'm hands up when it comes to this.
I'm starting to think this could be a bug... there's an
updateChart()
method on the alpine component but I'm not sure how to trigger it...shoud be:
Trying it now...
this.chart.update()
is still causing an issue for meI'll send a PR..
GitHub
Update card.blade.php by leandrocfe · Pull Request #6944 · filament...
Fixed Error: Canvas is already in use. Chart with ID '0' must be destroyed before the canvas with ID:
It is happening when the pollingInterval is enabled.
Hello Sir, this is already fixed right?
I have used this code to override card.blade.php to test if its working
https://github.com/filamentphp/filament/blob/ddf8d696de486f8b4fea01fab906c8ecfda0b13f/packages/admin/resources/views/components/stats/card.blade.php
its working but in my case the chart color isnt updating
idk if its on my end, there's no error on console also.
I have 3 colors which are
'danger' => yesterdays count > todays count
'warning' => equal value
'success' => todays count > yesterdays count
this is what i used to change the color every polling
and it only changes the description() and descriptionIcon() color leaving chart color unchanged unless I refresh the page...
GitHub
Release v2.17.51 · filamentphp/filament
What's Changed
Global search result scroll bar visibility by @valpuia in #6914
Should display dynamic options for checkbox list by @juliomotol in #6935
introduced without Middleware in pages a...
Hello, Nice work sir!
I'm kinda wondering about the color of the chart when I attempt to change it
the polling only updates the descriptionColor()
idk if its only on my end..