You are here

protected function ChartsGraphsBluff::_get_encoded_parameters in Charts and Graphs 6.2

Same name and namespace in other branches
  1. 7 apis/charts_graphs_bluff/charts_graphs_bluff.class.inc \ChartsGraphsBluff::_get_encoded_parameters()
1 call to ChartsGraphsBluff::_get_encoded_parameters()
ChartsGraphsBluff::get_chart in apis/charts_graphs_bluff/charts_graphs_bluff.class.inc
Function that renders data.

File

apis/charts_graphs_bluff/charts_graphs_bluff.class.inc, line 143
Implementation of abstract class ChartsGraphsCanvas for Bluff library.

Class

ChartsGraphsBluff
Implementation of abstract class ChartsGraphsCanvas for Bluff library.

Code

protected function _get_encoded_parameters() {
  $output = "\n";
  foreach ($this->final_parameters as $key => $value) {
    if (is_array($value)) {
      $function_parameters = '';
      foreach ($value as $val) {
        $function_parameters .= sprintf(', %s', $val);
      }
      if (strlen($function_parameters) > 0) {
        $function_parameters = substr($function_parameters, 2);
      }
      $output .= sprintf("\tg.%s(%s);\n", $key, $function_parameters);
    }
    else {
      $output .= sprintf("\tg.%s = %s;\n", $key, $value);
    }
  }
  return $output;
}