Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
                
                Forum's Guidelines
            
You can process your dashboard widget's data in method dataSource like this:
    protected function dataSource()
    {
        return CSV::file("data/customer_product_dollarsales2.csv")
                ->fieldSeparator(";")
                ->select('customerName', 'productLine', 'productName','dollar_sales')
                ->where('customerName','<','Am')
                ->where('orderYear','>',2003)
                ->run() //After run(), we will get DataStore, we continue to process data with ColumnMeta and Pivot
                ->process(
                    // Add processes here
                    \koolreport\processes\ColumnMeta::process([
                        ...
                    ])
                    ->pipe(new \koolreport\processes\Map([
                        ...
                    ]))                    
                );
    } 
thanks Sebastian for your comment, actually my question is that when i apply run() to data in array it doesn't work this is my code:
return $this->dashboard()->getapiData("subserv")->run()
it gives me the following message:
Message: Call to a member function run() on array Line: 32
Well, you convert array data into DataStore and then you can process data.
protected function dataSource()
{
    $data = $this->dashboard()->getapiData("subserv");
    return (new \koolreport\core\DataStore($data))->process(
                    // Add processes here
                    \koolreport\processes\ColumnMeta::process([
                        ...
                    ])
                    ->pipe(new \koolreport\processes\Map([
                        ...
                    ]))     
    );
}
Let us know if it works.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo