You are here

class ChartsDefaultSettings in Charts 8.3

Same name and namespace in other branches
  1. 8.4 src/Settings/ChartsDefaultSettings.php \Drupal\charts\Settings\ChartsDefaultSettings
  2. 5.0.x src/Settings/ChartsDefaultSettings.php \Drupal\charts\Settings\ChartsDefaultSettings

Hierarchy

Expanded class hierarchy of ChartsDefaultSettings

5 files declare their use of ChartsDefaultSettings
ChartsBaseSettingsForm.php in src/Settings/ChartsBaseSettingsForm.php
ChartsBaseSettingsFormTest.php in tests/src/Unit/Settings/ChartsBaseSettingsFormTest.php
ChartsBlock.php in modules/charts_blocks/src/Plugin/Block/ChartsBlock.php
ChartsConfigForm.php in src/Form/ChartsConfigForm.php
ChartsDefaultSettingsTest.php in tests/src/Unit/Settings/ChartsDefaultSettingsTest.php

File

src/Settings/ChartsDefaultSettings.php, line 7

Namespace

Drupal\charts\Settings
View source
class ChartsDefaultSettings {
  protected $colors;

  /**
   * ChartsDefaultSettings constructor.
   */
  public function __construct() {
    $this->colors = new ChartsDefaultColors();
  }
  public $defaults = [
    'type' => 'line',
    'library' => NULL,
    'grouping' => FALSE,
    'label_field' => NULL,
    'data_fields' => NULL,
    'field_colors' => NULL,
    '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,
    'width' => NULL,
    'width_units' => '%',
    'height' => NULL,
    'height_units' => 'px',
    'xaxis_title' => '',
    'xaxis_labels_rotation' => 0,
    'yaxis_title' => '',
    'yaxis_min' => '',
    'yaxis_max' => '',
    'yaxis_prefix' => '',
    'yaxis_suffix' => '',
    'yaxis_decimal_count' => '',
    'yaxis_labels_rotation' => 0,
    'green_to' => 100,
    'green_from' => 85,
    'yellow_to' => 85,
    'yellow_from' => 50,
    'red_to' => 50,
    'red_from' => 0,
    'max' => 100,
    'min' => 0,
  ];

  /**
   * @return array
   */
  public function getDefaults() {
    $defaults = $this->defaults;
    $defaults['colors'] = $this->colors
      ->getDefaultColors();
    return $defaults;
  }

  /**
   * @param array $defaults
   */
  public function setDefaults(array $defaults) {
    $this->defaults = $defaults;
  }

}

Members