KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Count method returns 0 #1511

Open Satish Dongol opened this topic on on Jul 2, 2020 - 2 comments

Satish Dongol commented on Jul 2, 2020

I am trying to get the count of data in my barchart, but the datastore's count method always returns 0.

<?php
use \koolreport\widgets\google\BarChart;
$dataStore = $report->dataStore('reportGraphData');
?>

<div class="bar-chart">
    <?php
    BarChart::create(array(
        'title' => $dataStore->count() == 15 ? 'Top 15 results' : '',
        "width"=>'100%',
        "height"=>'600px',
        "dataSource"=>$dataStore,
        "options" => [
            'legend' => 'none',
            "colors" => ['#4C9850'],
            "backgroundColor" => 'transparent',
        ],
    ));
    ?>
</div>

This is my code. The count is working for other charts but not for the bar chart here. Any other way to get the count of data?

Thanks

Satish Dongol commented on Jul 2, 2020

Never mind. Figured out my issue.

David Winterburn commented on Jul 3, 2020

Please share your solution here so that it could be useful for other users as well. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None