below static code was working perfectly ,
$this->widget('ext.highcharts.HighchartsWidget',array(
'options' => array(
'series' => array(array(
'type' => 'pie',
'data' =>
array(
//$test_chart
array('Firefox', 44.2),
array('IE7', 26.6),
array('IE6', 20),
array('Chrome', 3.1),
array('Other', 5.4)
)
))
)
));
then am convert in to this dynamically,
fetch contents into db
<?php
//$categories_fetch=array();
$connection=Yii::app()->db;
$sqlf = "SELECT pos_item_inventory.id as inid,pos_item_inventory.itemid as itemid,pos_item_inventory.total_stock,pos_item.name FROM pos_item_inventory LEFT JOIN pos_item on pos_item.id=pos_item_inventory.itemid";
$command = $connection->createCommand($sqlf);
$dataReaderf = $command->queryAll();
$test=array();
foreach($dataReaderf as $key=>$val) {
$test[]=array($val['name'],$val['total_stock']);
}
print value of $dataReaderf is
Array ( [0] => Array ( [inid] => 1 [itemid] => 1 [total_stock] => 110 [name] => xperia Z ) [1] => Array ( [inid] => 2 [itemid] => 2 [total_stock] => 10 [name] => VIO GT3211 ) [2] => Array ( [inid] => 3 [itemid] => 3 [total_stock] => 19 [name] => IBM Vespo ) )
$this->widget('ext.highcharts.HighchartsWidget',array(
'options' => array(
'series' => array(array(
'type' => 'pie',
'data' => $test
//array(
// //$test_chart
// array('Firefox', 44.2),
// array('IE7', 26.6),
// array('IE6', 20),
// array('Chrome', 3.1),
// array('Other', 5.4)
// )
))
)
));
then don’t see anything , Please help me!