You are here

class ChartjsData in Charts 8.3

Class ChartjsData.

@package Drupal\charts_chartjs\Settings\Chartjs

Chart.js data options are described here:

Hierarchy

  • class \Drupal\charts_chartjs\Settings\Chartjs\ChartjsData implements \Drupal\charts_chartjs\Settings\Chartjs\JsonSerializable

Expanded class hierarchy of ChartjsData

See also

http://www.chartjs.org/docs/latest/getting-started/

1 file declares its use of ChartjsData
Chartjs.php in modules/charts_chartjs/src/Plugin/chart/Chartjs.php

File

modules/charts_chartjs/src/Settings/Chartjs/ChartjsData.php, line 13

Namespace

Drupal\charts_chartjs\Settings\Chartjs
View source
class ChartjsData implements \JsonSerializable {

  /**
   * Property that specifies the labels.
   *
   * @var mixed
   */
  private $labels;

  /**
   * An object that specifies the datasets.
   *
   * @var mixed
   */
  private $datasets;

  /**
   * Get Chart Axis property that specifies a title for the axis.
   *
   * @return mixed
   *   Labels.
   */
  public function getLabels() {
    return $this->labels;
  }

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

  /**
   * Get an object that specifies the datasets.
   *
   * @return mixed
   *   Datasets.
   */
  public function getDatasets() {
    return $this->datasets;
  }

  /**
   * Set an object that specifies the datasets.
   *
   * @param mixed $datasets
   *   Datasets.
   */
  public function setDatasets($datasets) {
    $this->datasets = $datasets;
  }

  /**
   * Json Serialize.
   *
   * @return array
   *   Json Serialize.
   */
  public function jsonSerialize() {
    $vars = get_object_vars($this);
    return $vars;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChartjsData::$datasets private property An object that specifies the datasets.
ChartjsData::$labels private property Property that specifies the labels.
ChartjsData::getDatasets public function Get an object that specifies the datasets.
ChartjsData::getLabels public function Get Chart Axis property that specifies a title for the axis.
ChartjsData::jsonSerialize public function Json Serialize.
ChartjsData::setDatasets public function Set an object that specifies the datasets.
ChartjsData::setLabels public function Set Labels property.