Strange deal, if you look at the images provided, the grid view shows county and polecount but if you look at the chart (see attached image) you will see under categories it is 0 1 2 etc… instead of LOS ANGELES COUNTY, ORANGE COUNTY etc…
Below is the code for the widget.
Any help would be great.
<?php
$query = "SELECT ownership.id,COUNT( deviations.id ) as polecount , counties.name as county
FROM `ownership` , counties, deviations
WHERE ownership.county_id = counties.id
AND ownership.id = deviations.pole_id
AND deviations.commondeviation_id <>1
AND deviations.inspection_date between DATE_FORMAT(NOW() ,'%Y-01-01') AND NOW()
GROUP BY counties.name";
$count=Yii::app()->db->createCommand($query)->queryScalar();
$dataProvider = new CSqlDataProvider($query, array(
'totalItemCount'=>$count,
));
$model = new Ownership;
$newDataProvider=$model->newsearch();
$this->widget('bootstrap.widgets.TbExtendedGridView', array(
//'filter'=>$model,
'type'=>'striped bordered',
'dataProvider' => $dataProvider,
'template' => "{items}\n{extendedSummary}",
'columns' => array(
'polecount',
'county'
),
'chartOptions' => array(
'defaultView' => true,
'data' => array(
'series' => array(
array(
'name' => 'Poles',
'attribute' => 'polecount'
)
),
'xAxis' => array(
'categories' => 'county'),
),
),
'config' => array(
'chart' => array(
// 'width' => '800' // default reflow
)
),
),
));
?>