Sore Rekan2,
Mudah2an ada yg bs bantu, sy sdg coba2 XGoogleChart cm ada mslh saat merender data dari database, untuk cth script bs di lihat di :
http://www.eha.ee/labs/yiiplay/index.php/en/site/extension?view=charts
cth script :
$this->widget(‘ext.widgets.google.XGoogleChart’,array(
'type'=>'pie',
'title'=>'Browser market 2008',
'data'=>array('IE7'=>22,'IE6'=>30.7,'IE5'=>1.7,'Firefox'=>36.5,'Mozilla'=>1.1,'Safari'=>2,'Opera'=>1.4),
'size'=>array(400,300), // width and height of the chart image
'color'=>array('6f8a09', '3285ce','dddddd'), // if there are fewer color than slices, then colors are interpolated.
));
sy ingin mengganti nilai script di bwh diambil dari database
…
‘data’=>array(‘IE7’=>22,‘IE6’=>30.7,‘IE5’=>1.7,‘Firefox’=>36.5,‘Mozilla’=>1.1,‘Safari’=>2,‘Opera’=>1.4),
…
sy sdh coba sperti ini :
…
$items=array();
foreach($data as $i)
{
$items1=$i[‘stk_akhir’];
$items2=$i[‘brg_nama’];
$items[]=array($items1 => $items2);
}
$this->widget(‘application.extensions.XGoogleChart’,array(
'type'=>'pie',
'title'=>'Persedian Barang',
[b]'data'=>$items,[/b]
'size'=>array(400,300), // width and height of the chart image
'color'=>array('6f8a09', '3285ce','dddddd'), // if there are fewer color than slices, then colors are interpolated.
));
… tapi chart nya tidak muncul, sdh cb googling tp blm ketemu solusinya, mudah2an reka2 ada yg bs bantu
Terimas kasih