You are here

ChartAxisBase.php in Charts 5.0.x

Same filename and directory in other branches
  1. 8.4 src/Element/ChartAxisBase.php

File

src/Element/ChartAxisBase.php
View source
<?php

namespace Drupal\charts\Element;

use Drupal\Core\Render\Element\RenderElement;

/**
 * Provides a chart render element.
 */
abstract class ChartAxisBase extends RenderElement {

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    return [
      // Options: linear, logarithmic, datetime, labels.
      '#axis_type' => 'linear',
      '#title' => '',
      '#title_color' => '#000',
      // Options: normal, bold.
      '#title_font_weight' => 'normal',
      // Options: normal, italic.
      '#title_font_style' => 'normal',
      '#title_font_size' => 12,
      // CSS value for font size, e.g. 1em or 12px.
      '#labels' => NULL,
      '#labels_color' => '#000',
      // Options: normal, bold.
      '#labels_font_weight' => 'normal',
      // Options: normal, italic.
      '#labels_font_style' => 'normal',
      // CSS value for font size, e.g. 1em or 12px.
      '#labels_font_size' => NULL,
      // Integer rotation value, e.g. 30, -60 or 90.
      '#labels_rotation' => NULL,
      '#grid_line_color' => '#ccc',
      '#base_line_color' => '#ccc',
      '#minor_grid_line_color' => '#e0e0e0',
      // Integer max value on this axis.
      '#max' => NULL,
      // Integer minimum value on this axis.
      '#min' => NULL,
      // Display axis on opposite normal side.
      '#opposite' => FALSE,
    ];
  }

}

Classes

Namesort descending Description
ChartAxisBase Provides a chart render element.