You are here

protected function Billboard::getOptionsByType in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x modules/charts_billboard/src/Plugin/chart/Library/Billboard.php \Drupal\charts_billboard\Plugin\chart\Library\Billboard::getOptionsByType()

Get options.

Parameters

string $type: The chart type.

array $element: The element.

Return value

array The returned options.

File

modules/charts_billboard/src/Plugin/chart/Library/Billboard.php, line 96

Class

Billboard
Define a concrete class for a Chart.

Namespace

Drupal\charts_billboard\Plugin\chart\Library

Code

protected function getOptionsByType($type, array $element) {
  $options = $this
    ->getOptionsByCustomProperty($element, $type);
  if ($type === 'bar') {
    $options['width'] = $element['#width'];
  }
  return $options;
}