我正在使用Yii Highcharts扩展,我可以显示X的值但不能显示Y的值。 我的Highchart小部件代码是:
$user = Yii::app()->user->id ;
$xAxis = Yii::app()->db->createCommand()
->select('data')
->from('teste')
->where('Utilizador_idUtilizador=:ut', array( ':ut'=>$user))
->queryColumn();
$yAxis = Yii::app()->db->createCommand()
->select('racio')
->from('teste')
->where('Utilizador_idUtilizador=:ut', array( ':ut'=>$user))
->queryColumn();
$this->Widget('ext.highcharts.HighchartsWidget',array(
'options' =>array(
'title' => array('text' => 'Progressão'),
'xAxis' => array(
'categories' => $xAxis,
),
'yAxis' => array(
'title' => array('text' => 'valor'),
),
'series' => array(
array('name' => 'Racio','data' => $yAxis,'shadow' => false,
)
)
)
));
print_r($yAxis);
当我print_r($yAxis)
显示:
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 1 [5] => 0 [6] => 1 [7] => 1 )
如果我使用静态数组:
$yAxis = array(1,2,3,4,1,0,1,1);
它有效,当我print_r($yAxis)
显示时:Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 1 [5] => 0 [6] => 1 [7] => 1 )
{{1}},它的阵列相同!为什么动态数组不起作用?
任何人都可以帮助我吗? 谢谢你的时间。