nova-chartjs icon indicating copy to clipboard operation
nova-chartjs copied to clipboard

[BUG] series method not working with nova model

Open adaffre opened this issue 2 years ago • 0 comments

Describe the bug error when using the ->series([]) method instancing graph in a Laravel Nova resource card, using ->model('Class').

To Reproduce

(new \Coroowicaksono\ChartJsIntegration\BarChart())
                ->title('Misura')
                ->model('\App\Models\Misura') 
                ->col_xaxis('ora')
                ->options([
                    'queryFilter' => array([
                        'key' => 'ora',
                        'operator' => 'IS NOT NULL',
                    ])
                ])
                ->series(array([
                    'label' => 'Product A',
                    'filter' => [
                        'key' => 'type_id',
                        'value' => '1',
                    ],
                ]))
                ->width('2/3'),

Screenshots image

Dependencies Version:

  • Laravel Version: 9.2
  • Nova Version: 4.0
  • Nova-ChartJS Version: 0.4.0
  • DB: postgreSQL

adaffre avatar Jun 01 '22 19:06 adaffre