I am trying to create a bytes(y) vs time(x) chart. Sounds simple, but I’ve been stuck on this for days.
The time data array is retrieved from the controller via ‘dataProvider’=>‘enddate’ and is in the format YYYY-MM-DD hh:mm:ss. bytes is an integer.
I have this working if I use the xAxis categories for the times.
ie.
$this->Widget('ext.ActiveHighcharts.HighchartsWidget', array(
'dataProvider'=>$dataProvider,
'template'=>'{items}',
'options'=> array(
'xAxis'=>array(
'title' => array('text' => 'Time',),
'categories' => 'enddate',
),
'series'=>array(
array(
'type'=>'spline',
'name'=>'Download', //title of data
'dataResource'=>'bytesout', //data resource according to database column
),
),
),
);
But my times are not regular intervals, so I want it use a timedate ‘type’ and pass the times and bytes as x,y data in the ‘series’ data.
i.e
'xAxis'=>array(
'type'=>'datetime',
'title' => array('text' => 'Time',),
),
'series'=>array(
array(
'type'=>'spline',
'name'=>'Download', //title of data
'dataResource'=>array('enddate','bytesout'), //data resource according to datebase column
),
),
There seems to be an issue with how I am passing the x,y as the chart is blank.
After looking at api.highcharts.com/highcharts#series.data.y I have also tried the following but still can’t get it working.
'dataResource'=>array('x'=>'enddate','y'=>'bytesout'),