function _chart_encode_data in Google Chart Tools: Image Charts 5
Same name and namespace in other branches
- 6 chart.module \_chart_encode_data()
- 7 chart.module \_chart_encode_data()
Encode an array of data.
Missing data placeholder 'NULL' is replaced the appropriate placeholder.
Return value
string
1 call to _chart_encode_data()
- chart_build in ./
chart.module - Build chart query string.
File
- ./
chart.module, line 322 - Google Charting API. Developed by Tj Holowaychuk
Code
function _chart_encode_data($data) {
if (count($data)) {
foreach ($data as $k => $v) {
if (is_array($v) || is_object($v)) {
$output .= '|';
$output .= _chart_encode_data($v, $type);
}
else {
if ($v != 'NULL') {
$output .= $v . ',';
}
else {
$output .= '-1,';
}
}
}
}
return trim($output, '|,');
}