Yii で円グラフを作成するために XGoogleChart を使用しようとしましたが、このチュートリアルhttp://www.eha.ee/labs/yiiplay/index.php/en/site/extension?view=chartsのような円グラフを作成したいと思っています。そして、私はこのような簡単なコードを作ってみました:
<?php
$data=Stock::model()->findAll(array("select"=>"t1.item_name,stock",
"join"=>"JOIN tb_dtl t1 ON
t1.brg_id=t.brg_id",
'limit'=>5
));
$items=array();
foreach($data as $i)
{
$items1=$i['item_name'];
$items2=$i['stock'];
$items[]=array($items1 => $items2);
}
$this->widget('application.extensions.XGoogleChart',array(
'type'=>'pie',
'title'=>'Inventory',
**'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.
));
?>
問題は、グラフが表示されないことです。私のコードの何が問題なのか、どんな体でも私を助けることができます。ありがとう