You are here

public static function ChartBase::getDefaultSettings in Charts 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/chart/Library/ChartBase.php \Drupal\charts\Plugin\chart\Library\ChartBase::getDefaultSettings()

Gets defaults settings.

Return value

array The defaults settings.

File

src/Plugin/chart/Library/ChartBase.php, line 71

Class

ChartBase
Base class Chart plugins.

Namespace

Drupal\charts\Plugin\chart\Library

Code

public static function getDefaultSettings() {
  $defaults = [
    'type' => 'line',
    'library' => NULL,
    'grouping' => FALSE,
    'fields' => [
      'label' => NULL,
      'data_providers' => NULL,
    ],
    'display' => [
      'title' => '',
      'title_position' => 'out',
      'data_labels' => FALSE,
      'data_markers' => TRUE,
      'legend' => TRUE,
      'legend_position' => 'right',
      'background' => '',
      'three_dimensional' => FALSE,
      'polar' => FALSE,
      'tooltips' => TRUE,
      'tooltips_use_html' => FALSE,
      'dimensions' => [
        'width' => NULL,
        'width_units' => '%',
        'height' => NULL,
        'height_units' => 'px',
      ],
      'gauge' => [
        'green_to' => 100,
        'green_from' => 85,
        'yellow_to' => 85,
        'yellow_from' => 50,
        'red_to' => 50,
        'red_from' => 0,
        'max' => 100,
        'min' => 0,
      ],
      'colors' => self::getDefaultColors(),
    ],
  ];
  return $defaults;
}