My code
$data = array('cols' => array(array('label' => 'Time Period', 'type'
=> 'string')),
'rows' => array());
for ($x=0;$x<count($sp_info);$x++) {
$data['cols'][]=array('label' => "$sp_info[$x]", 'type' =>
'number');
}
for ($z=0;$z<count($time_frame);$z++) {
$data['rows'][$z] = array('c' => array('v' =>
"$time_frame[$z]", 'f'=>"null"));
$counthits=rtrim($count_arr[$z], ",");
$count_arr1=explode(",",$counthits);
for ($y=0;$y<count($count_arr1);$y++) {
$data['rows'][$z]['c'][$y]= array('v' =>
"$count_arr1[$y]",
'f'=>"null");
}
}
Array
(
[cols] => Array
(
[0] => Array
(
[label] => Time Period
[type] => string
)
[1] => Array
(
[label] => Andy Motts ([email protected])
[type] => number
)
[2] => Array
(
[label] => Eileen Lamblast ([email protected])
[type] => number
)
[3] => Array
(
[label] => Apurva M ([email protected])
[type] => number
)
)
now my cols format is correct ...
but my rows format is off ....
[rows] => Array
(
[0] => Array
(
[c] => Array
(
[v] => 30 October 2012
[f] => null
[0] => Array /// this structure should
not be tehre ... it should be [v][f][v][f]......
(
[v] => 0
[f] => null
)
[1] => Array
(
[v] => 0
[f] => null
)
[2] => Array
(
[v] => 2
[f] => null
)
)
)
[1] => Array
(
[c] => Array
(
[v] => 25 October 2012
[f] => null
[0] => Array
(
[v] => 3
[f] => null
)
[1] => Array
(
[v] => 0
[f] => null
)
[2] => Array
(
[v] => 0
[f] => null
)
)
)
can some one help me figure out hwat i am doing wrong ...
$data['rows'][$z]['c'][$y]= array('v' => "$count_arr1[$y]",
'f'=>"null");
i have tried
$data['rows'][$z]['c']= array('v' => "$count_arr1[$y]",
'f'=>"null");
$data['rows'][$z]['c'][]= array('v' => "$count_arr1[$y]",
'f'=>"null");
i dont know how what i seem to be doign wrong....
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.