You are here

protected function ChartsGraphsGoogleCharts::_get_encoded_text_labels in Charts and Graphs 7

Same name and namespace in other branches
  1. 6.2 apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc \ChartsGraphsGoogleCharts::_get_encoded_text_labels()
1 call to ChartsGraphsGoogleCharts::_get_encoded_text_labels()
ChartsGraphsGoogleCharts::_encode_data in apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc

File

apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc, line 263
Implementation of abstract class ChartsGraphsCanvas for Google Charts library.

Class

ChartsGraphsGoogleCharts
Implementation of abstract class ChartsGraphsCanvas for Google Charts library.

Code

protected function _get_encoded_text_labels() {
  $chxl = '';
  if (is_array($this->x_labels)) {

    /**
     * Workaround a apparently Google Charts bug: data labels are inverted on
     * side bar graphs.
     */
    $x_labels = $this->type == 'side_bar' ? array_reverse($this->x_labels) : $this->x_labels;
    foreach ($x_labels as $label) {
      $chxl .= '|' . drupal_encode_path($label);
    }
  }
  return $chxl;
}