© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Albert Lens

Bar Chartjs Animation how to animate?

Hello.
I am using chartjs of several type and everything is OK but the animation works for line charts, but not for the rest (bars, pie, doughnut). https://filamentphp.com/docs/3.x/widgets/charts

For the line chart (which animates correctly) I have used:
 return [
            'datasets' => [
                [
                    'label' => 'Tipos de Finca',
                    'data' => $data->map(fn (TrendValue $value) => $value->aggregate),
                    'borderColor'=> 'rgb(75, 192, 192)',
                    'borderWidth'=> 6,
                    'pointBorderWidth' => 12,
                    'animations' => [
                        'tension' => [
                          'duration' => 1500,
                          'easing' => 'easeInOutQuint',
                          'from' => 1,
                          'to' => 0,
                          'loop' => false
                        ],
                    ],
                ],
            ],
            'labels' => $data->map(fn (TrendValue $value) => $value->date),
        ];
 return [
            'datasets' => [
                [
                    'label' => 'Tipos de Finca',
                    'data' => $data->map(fn (TrendValue $value) => $value->aggregate),
                    'borderColor'=> 'rgb(75, 192, 192)',
                    'borderWidth'=> 6,
                    'pointBorderWidth' => 12,
                    'animations' => [
                        'tension' => [
                          'duration' => 1500,
                          'easing' => 'easeInOutQuint',
                          'from' => 1,
                          'to' => 0,
                          'loop' => false
                        ],
                    ],
                ],
            ],
            'labels' => $data->map(fn (TrendValue $value) => $value->date),
        ];


I try the same for the other charts and nothing happens.

Any help of where I can find the info? I have already checked the official docs in https://www.chartjs.org/docs/latest/
image.png
Chart widgets - Widgets - Filament
Chart.js | Chart.js
Open source HTML5 Charts for your website
Solution
'datasets' => [
    [
        'data' => [...],
        'animation' => [
            'duration' => 1500
        ],
    ],
],
'datasets' => [
    [
        'data' => [...],
        'animation' => [
            'duration' => 1500
        ],
    ],
],
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

@livwewireScripts triggers indefinite search bar animation
FilamentFFilament / ❓┊help
3y ago
How can I install Chartjs plugins?
FilamentFFilament / ❓┊help
3y ago
register chartjs plugin
FilamentFFilament / ❓┊help
3y ago
ChartJS custom tooltip positioner
FilamentFFilament / ❓┊help
14mo ago