Yii Framework Forum: Menampilkan Data Array Dari Database - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Menampilkan Data Array Dari Database Rate Topic: -----

#1 User is offline   vient 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 03-July 11

Posted 24 April 2013 - 02:53 AM

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/la...ion?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',
'data'=>$items,
'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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users