coroo / nova-chartjs

A Simple Dashboard Chart in Laravel Nova using Chart JS. Starting create your own dashboard with Chart JS Integration can save your time and help you maintain consistency across standard elements such as Bar, Stacked, Line, Area, Doughnut and Pie Chart.
https://coroo.github.io/nova-chartjs
MIT License
215 stars 71 forks source link

[BUG] Metrics filter nog showing without model #184

Open matthbon opened 1 week ago

matthbon commented 1 week ago

Describe the bug I insert custom data because I need to join from different tables. All is showing good. But the metrics filter is not showing.

To Reproduce Steps to reproduce the behavior:

            ->title(__('Revenue Costs Profit Per Day'))
            ->animations([
                'enabled' => true,
                'easing' => 'easeinout',
            ])
            ->series([
                [
                    'barPercentage' => 0.5,
                    'label' => __('Revenue'),
                    'borderColor' => '#f7a35c',
                    'data' => [15, 30, 50, 70, 90, 110, 130, 150, 170, 190],
                ],[
                    'barPercentage' => 0.5,
                    'label' => __('Costs'),
                    'borderColor' => '#d8b088',
                    'data' => [5, 10, 20, 30, 40, 50, 60, 70, 80, 90],
                ],[
                    'barPercentage' => 0.5,
                    'label' => __('Profit'),
                    'borderColor' => '#90ed7d',
                    'data' => [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                ],
            ])
            ->options([
                'latestData' => 1,
                'btnFilter' => true,
                'btnFilterDefault' => 'YTD',
                'btnFilterList' => [
                    'YTD'   => 'Year to Date',
                    'QTD'   => 'Quarter to Date',
                    'MTD'   => 'Month to Date',
                    '30'   => '30 Days', // numeric key will be set to days
                    '28'   => '28 Days', // numeric key will be set to days
                ],
                'xaxis' => [
                    'categories' => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
                ],
            ])
            ->width('full');

Expected behavior Even without adding a model I expect the btn filter list to show so i can filter and implement the filter myself.

Dependencies Version (please complete the following information):

Desktop (please complete the following information):