You are here

function flot_handler_field_datapoint::flot_render in Flot 7

Same name and namespace in other branches
  1. 6 views/flot_handler_field_datapoint.inc \flot_handler_field_datapoint::flot_render()

Return an array usable as a plot point by flot.

File

flot_views/views/flot_handler_field_datapoint.inc, line 163

Class

flot_handler_field_datapoint

Code

function flot_render($values) {
  if ($this->use_date) {
    $series = $values->{$this->series_field};
    $series_label = format_date($values->{$this->series_field}, $this->options['series']['date_format']);
  }
  else {
    $series_label = $series = check_plain($values->{$this->series_field});
  }
  $value = check_plain($values->{$this->value_field});
  return array(
    'value' => array(
      $series,
      $value,
    ),
    'label' => array(
      $series_label,
      $value,
    ),
  );
}