KoolReport's Forum

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

Barchart widget not working #461

Open jeyashree opened this topic on on Sep 12, 2018 - 7 comments

jeyashree commented on Sep 12, 2018

Hi,

I used the below code for barchart in codeigniter,but its not working. Please guide.

require_once APPPATH."/libraries/koolreport/autoload.php";
	use \koolreport\instant\Widget;
	use \koolreport\widgets\google\Table;
	use \koolreport\widgets\google\BarChart;

   Widget::create(BarChart::class,array(
        "data"=>array(
            array("name"=>"Peter","age"=>35),
            array("name"=>"Karl","age"=>32),
        )
    ));

Thanks.

KoolReport commented on Sep 12, 2018

Does it show any error?

jeyashree commented on Sep 14, 2018

No errors shown.

KoolReport commented on Sep 14, 2018

Is this possible that you can send us the url to the page with this issue.

jeyashree commented on Sep 14, 2018

HI,

"TypeError: google.visualization[this.chartType] is not a constructor"

This error shown on console.

Thanks.

jeyashree commented on Sep 14, 2018

thats the local url.i can't send

jeyashree commented on Sep 14, 2018

now barchart with static content is working.But not for dynamic data. here the code is,


   $vv=array(
            array("created_date"=>"2018-02-28","total_sales"=>11),
            array("created_date"=>"2018-03-05","total_sales"=>1),
        );

foreach($orders as $val){
		$vals[]=array('created_date'=>$val['created_date'],'total_sales'=>$val['total_sales']);
		}

 Widget::create(BarChart::class,array(
        "data"=>$vv;
    ));
		
       Widget::create(BarChart::class,array(
        "data"=>$valss
        
    ));

In the above the first one is working.

Both the array prints the same value.

$vv=> Array ( [0] => Array ( [created_date] => 2018-02-28 [total_sales] => 11 ) [1] => Array ( [created_date] => 2018-03-05 [total_sales] => 1 ) )

$vals=> Array ( [0] => Array ( [created_date] => 2018-02-28 [total_sales] => 11 ) [1] => Array ( [created_date] => 2018-03-05 [total_sales] => 1 ) )

Please help and reply soon.

Thanks.

KoolReport commented on Sep 14, 2018

I will tell dev.team to look into your case and come back to you as soon as possible.

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