Heres a code on how to create Bar Chart using Yii extension HighChart
$this->widget('ext.highcharts.HighchartsWidget',
array(
'id' => 'something',
'options'=> array(
'chart' => array(
'defaultSeriesType' => 'bar',
'style' => array(
'fontFamily' => 'Verdana, Arial, Helvetica, sans-serif',
),
),
'title' => array(
'text' => 'Distribution of Population',
),
'xAxis' => array(
'title' => array(
'text' => 'Place',
),
'categories' => array('Rural','Urban'),
'labels' => array(
'step' => 1,
'rotation' => 0,
'y' => 20,
),
),
'yAxis' => array(
'title' => array(
'text' => 'Number of Population',
),
),
'series' => array(
array(
'name' => 'Boys',
'data' => array(20,60),
),
array(
'name' => 'Girls',
'data' => array(80,120),
),
)
)
)
);
very helpful post
ReplyDeleteWorks fine, thanks (yii 1.1.14).
ReplyDelete