leandrocfe / filament-apex-charts

Apex Charts integration for Filament PHP.
https://filament-apex-charts-demo.leandroferreira.dev.br
MIT License
300 stars 38 forks source link

Rendering problem using single select filter #18

Closed billmn closed 1 year ago

billmn commented 1 year ago

There is some rendering problem on single select filter change, this is the result:

https://github.com/leandrocfe/filament-apex-charts/assets/779534/55a02002-a77c-4451-860e-18ed9cc16ee8

With filters form all works fine.

I have used this example code:

class TestApexTicketsChart extends ApexChartWidget
{
    protected static string $chartId = 'testApexChart';

    protected static ?string $heading = 'Test Apex Chart';

    protected int | string | array $columnSpan = 'full';

    public ?string $filter = '6_months';

    protected function getFilters(): ?array
    {
        return [
            '6_months' => 'Last 6 months',
            '12_months' => 'Last 12 months',
            '24_months' => 'Last 24 months',
        ];
    }

    protected function getOptions(): array
    {
        return [
            'chart' => [
                'type' => 'line',
                'height' => 300,
            ],
            'series' => [
                [
                    'name' => 'Test Apex Chart',
                    'data' => [2, 4, 6, 10, 14, 7, 2, 9, 10, 15, 13, 18],
                ],
            ],
            'xaxis' => [
                'categories' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            ],
        ];
    }
}
leandrocfe commented 1 year ago

Hi @billmn , Would you like to try this version? composer require leandrocfe/filament-apex-charts:"^2.0"

billmn commented 1 year ago

Hi @leandrocfe, with this version seems ok