You are here

class ChartData in Charts 8.3

Same name in this branch
  1. 8.3 modules/charts_billboard/src/Settings/Billboard/ChartData.php \Drupal\charts_billboard\Settings\Billboard\ChartData
  2. 8.3 modules/charts_c3/src/Settings/CThree/ChartData.php \Drupal\charts_c3\Settings\CThree\ChartData
Same name and namespace in other branches
  1. 8 modules/charts_c3/src/Settings/CThree/ChartData.php \Drupal\charts_c3\Settings\CThree\ChartData

Chart Data.

Hierarchy

  • class \Drupal\charts_c3\Settings\CThree\ChartData implements \Drupal\charts_c3\Settings\CThree\JsonSerializable

Expanded class hierarchy of ChartData

1 file declares its use of ChartData
C3.php in modules/charts_c3/src/Plugin/chart/C3.php

File

modules/charts_c3/src/Settings/CThree/ChartData.php, line 8

Namespace

Drupal\charts_c3\Settings\CThree
View source
class ChartData implements \JsonSerializable {
  private $columns = [];
  private $type;
  private $labels = TRUE;
  private $x = 'x';
  private $groups = '';
  private $xs;

  /**
   * Get X.
   *
   * @return mixed
   *   X.
   */
  public function getX() {
    return $this->x;
  }

  /**
   * Set X.
   *
   * @param mixed $x
   *   X.
   */
  public function setX($x) {
    $this->x = $x;
  }

  /**
   * Get Columns.
   *
   * @return array
   *   Columns.
   */
  public function getColumns() {
    return $this->columns;
  }

  /**
   * Set Columns.
   *
   * @param mixed $columns
   *   Columns.
   */
  public function setColumns($columns) {
    $this->columns = $columns;
  }

  /**
   * Get Type.
   *
   * @return mixed
   *   Type.
   */
  public function getType() {
    return $this->type;
  }

  /**
   * Set Type.
   *
   * @param mixed $type
   *   Type.
   */
  public function setType($type) {
    $this->type = $type;
  }

  /**
   * Get Labels.
   *
   * @return mixed
   *   Labels.
   */
  public function getLabels() {
    return $this->labels;
  }

  /**
   * Set Labels.
   *
   * @param mixed $labels
   *   Labels.
   */
  public function setLabels($labels) {
    $this->labels = $labels;
  }

  /**
   * Get Stacking.
   *
   * @return mixed
   *   Stacking.
   */
  public function getGroups() {
    return $this->groups;
  }

  /**
   * Set Stacking.
   *
   * @param array $groups
   *   Stacking.
   */
  public function setGroups($groups) {
    $this->groups = $groups;
  }

  /**
   * @return mixed
   */
  public function getXs() {
    return $this->xs;
  }

  /**
   * @param mixed $xs
   */
  public function setXs($xs) {
    $this->xs = $xs;
  }

  /**
   * Json Serialize.
   *
   * @return array
   *   Json Serialize.
   */
  public function jsonSerialize() {
    $vars = get_object_vars($this);
    if ($vars['type'] == 'pie' || $vars['type'] == 'donut') {
      unset($vars['x']);
    }
    return $vars;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChartData::$columns private property
ChartData::$groups private property
ChartData::$labels private property
ChartData::$type private property
ChartData::$x private property
ChartData::$xs private property
ChartData::getColumns public function Get Columns.
ChartData::getGroups public function Get Stacking.
ChartData::getLabels public function Get Labels.
ChartData::getType public function Get Type.
ChartData::getX public function Get X.
ChartData::getXs public function
ChartData::jsonSerialize public function Json Serialize.
ChartData::setColumns public function Set Columns.
ChartData::setGroups public function Set Stacking.
ChartData::setLabels public function Set Labels.
ChartData::setType public function Set Type.
ChartData::setX public function Set X.
ChartData::setXs public function