laravel-charts icon indicating copy to clipboard operation
laravel-charts copied to clipboard

Can we select certain records

Open drxabdulrahman opened this issue 1 year ago • 2 comments

Hi Mr, many thanx for this great package. can I apply a filter by certain field , example I want to show only records with certain type (according to type column in database) reported by date monthly . other types will not be shown

drxabdulrahman avatar Oct 14 '24 13:10 drxabdulrahman

I found a solution which I cannot its good or non-profissional one. I created another Model class in a subfolder - ex 'App/Models/Stats/User.php', and I put a global scope to this model and use it in chart

drxabdulrahman avatar Oct 14 '24 14:10 drxabdulrahman

Another solution would be to create a database view with all the necessary data. Then you create a dummy model which references to this view. This is the model you're using for the charts.

Eruvaer74 avatar Oct 23 '24 19:10 Eruvaer74