You are here

public function Billboard::processChartType in Charts 8.3

Process the chart type.

Parameters

array $options: The chart options, which includes the type.

Return value

string $type The chart type.

1 call to Billboard::processChartType()
Billboard::buildVariables in modules/charts_billboard/src/Plugin/chart/Billboard.php
Creates a JSON Object formatted for Billboard.js Charts JavaScript to use.

File

modules/charts_billboard/src/Plugin/chart/Billboard.php, line 35

Class

Billboard
Define a concrete class for a Chart.

Namespace

Drupal\charts_billboard\Plugin\chart

Code

public function processChartType($options) {
  if ($options['type'] == 'column') {
    $type = 'bar';
  }
  else {
    $type = $options['type'];
  }

  // If Polar is checked, then convert to Radar chart type.
  if (isset($options['polar']) && $options['polar'] == 1) {
    $type = 'radar';
  }
  return $type;
}