You are here

protected function C3::getOptionsByType in Charts 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/charts_c3/src/Plugin/chart/Library/C3.php \Drupal\charts_c3\Plugin\chart\Library\C3::getOptionsByType()

Get options by type.

Parameters

string $type: The chart type.

array $element: The element.

Return value

array Return options.

File

modules/charts_c3/src/Plugin/chart/Library/C3.php, line 96

Class

C3
Define a concrete class for a Chart.

Namespace

Drupal\charts_c3\Plugin\chart\Library

Code

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