You are here

public static function BaseSettings::getChartTypes in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x src/Element/BaseSettings.php \Drupal\charts\Element\BaseSettings::getChartTypes()

The types of chart.

Return value

array The type options.

3 calls to BaseSettings::getChartTypes()
BaseSettings::processSettings in src/Element/BaseSettings.php
Processes the settings element.
ExposedChartType::buildExposedForm in src/Plugin/views/field/ExposedChartType.php
Render our chunk of the exposed handler form when selecting
ExposedChartType::buildOptionsForm in src/Plugin/views/field/ExposedChartType.php
Default options form that provides the label widget that all fields should have.

File

src/Element/BaseSettings.php, line 571

Class

BaseSettings
Provides a form element for setting a chart.

Namespace

Drupal\charts\Element

Code

public static function getChartTypes() {
  $plugin_manager = \Drupal::service('plugin.manager.charts_type');
  $plugin_definitions = $plugin_manager
    ->getDefinitions();
  $types_options = [];
  foreach ($plugin_definitions as $plugin_definition) {
    $types_options[$plugin_definition['id']] = $plugin_definition['label'];
  }
  return $types_options;
}