Milo S, on 13 February 2011 - 01:37 PM, said:
$this->widget('ext.highcharts.HighchartsWidget',array(
'options' => array(
'series' => array(array(
'type' => 'pie',
'data' => array(
array('Firefox', 44.2),
array('IE7', 26.6),
array('IE6', 20),
array('Chrome', 3.1),
array('Other', 5.4)
)
))
)
));For more examples and other options, see the Highcharts demo gallery and online documentation.
Now, this is my Code :
- Variabel $test using initial array and
- Variabel $hasil read from database
echo "Variabel Test : ";
$test=array(array('N', 50),array('R', 13));
print_r($test);
echo "<BR>";
$this->widget('ext.highcharts.highchartsWidget',array(
'options' => array(
'title' => array('text' => 'Variabel Test'),
'series' => array(
array(
'type' => 'pie',
'data' => $test
)
)
)
)
);
echo "Variabel Hasil : ";
$hasil=array();
foreach($dataReader as $row) {
//$bgtCat[]=$row['budget_category'];
//$bgtCount[]=$row['v_count'];
$hasil[]=array($row['budget_category'],$row['v_count']);
//$bgtAmount[]=$row['budget_value'];
};
print_r($hasil);
$this->Widget('ext.highcharts.HighchartsWidget', array(
'options' => array(
'title' => array('text' => 'Variabel Hasil'),
'series' => array(
array(
'type' => 'pie',
'data' => $hasil,
),
)
)
)
);
Output from variable $test and $hasil is same (check my attachment (using print_r)), but result in pie chart different??
is my code wrong ? Any Idea?
Attached File(s)
-
pie_chart.PNG (23.27K)
Number of downloads: 64

Help















