You are here

function _charts_series_values in Charts 6

Same name and namespace in other branches
  1. 7 charts.inc \_charts_series_values()

Even if the series have values with attributes, return only the numeric values of them.

Parameters

Array. A given data series with or without attributes.:

Return value

Array. A data series, but only with the values, without the attributes.

4 calls to _charts_series_values()
gd_image_chart_image in gd_image_chart/gd_image_chart.inc
_gd_image_chart_line2d in gd_image_chart/gd_image_chart.inc
_gd_image_chart_vbar2d in gd_image_chart/gd_image_chart.inc
_google_charts_series in google_charts/google_charts.inc
Convert all Series-level data.

File

./charts.inc, line 96
@author Bruno Massa http://drupal.org/user/67164

Code

function _charts_series_values($series) {
  $data = array();
  foreach ($series as $index => $value) {
    if (!is_numeric($index)) {
      continue;
    }
    if (is_array($value)) {
      $data[] = $value['#value'];
    }
    else {
      $data[] = $value;
    }
  }
  return $data;
}