You are here

class Chart in Charts 8.3

Same name in this branch
  1. 8.3 src/Annotation/Chart.php \Drupal\charts\Annotation\Chart
  2. 8.3 modules/charts_highcharts/src/Settings/Highcharts/Chart.php \Drupal\charts_highcharts\Settings\Highcharts\Chart

Chart.

Hierarchy

  • class \Drupal\charts_highcharts\Settings\Highcharts\Chart implements \Drupal\charts_highcharts\Settings\Highcharts\JsonSerializable

Expanded class hierarchy of Chart

1 file declares its use of Chart
Highcharts.php in modules/charts_highcharts/src/Plugin/chart/Highcharts.php
2 string references to 'Chart'
charts.views.schema.yml in config/schema/charts.views.schema.yml
config/schema/charts.views.schema.yml
ChartType::setChartType in modules/charts_google/src/Settings/Google/ChartType.php
Chart Type.

File

modules/charts_highcharts/src/Settings/Highcharts/Chart.php, line 8

Namespace

Drupal\charts_highcharts\Settings\Highcharts
View source
class Chart implements \JsonSerializable {
  private $type;
  private $width = NULL;
  private $height = NULL;
  private $backgroundColor;
  private $polar = NULL;
  private $options3d;

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

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

  /**
   * Get Width.
   *
   * @return int|null
   *   Width.
   */
  public function getWidth() {
    return $this->width;
  }

  /**
   * Set Width.
   *
   * @param int|null $width
   *   Width.
   */
  public function setWidth($width = NULL) {
    if (empty($width)) {
      $this->width = NULL;
    }
    else {
      $this->width = (int) $width;
    }
  }

  /**
   * Get Height.
   *
   * @return int|null
   *   Height.
   */
  public function getHeight() {
    return $this->height;
  }

  /**
   * Set Height.
   *
   * @param int|null $height
   *   Height.
   */
  public function setHeight($height = NULL) {
    if (empty($height)) {
      $this->height = NULL;
    }
    else {
      $this->height = (int) $height;
    }
  }

  /**
   * Get BackgroundColor.
   *
   * @return string
   *   BackgroundColor.
   */
  public function getBackgroundColor() {
    return $this->backgroundColor;
  }

  /**
   * Set BackgroundColor.
   *
   * @param string $backgroundColor
   *   BackgroundColor.
   */
  public function setBackgroundColor($backgroundColor) {
    $this->backgroundColor = $backgroundColor;
  }

  /**
   * Get Polar
   *
   * @return bool
   *   Polar.
   */
  public function getPolar() {
    return $this->polar;
  }

  /**
   * Set Polar.
   *
   * @param bool $polar
   *   Polar.
   */
  public function setPolar($polar) {
    $this->polar = $polar;
  }

  /**
   * Get 3D options.
   *
   * @return mixed
   *   The 3D options.
   */
  public function getOptions3D() {
    return $this->options3d;
  }

  /**
   * Set 3D options.
   *
   * @param mixed
   *   The 3D options.
   */
  public function setOptions3D($options3d) {
    $this->options3d = $options3d;
  }

  /**
   * Json Serialize.
   *
   * @return array
   *   Variables.
   */
  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
Chart::$backgroundColor private property
Chart::$height private property
Chart::$options3d private property
Chart::$polar private property
Chart::$type private property
Chart::$width private property
Chart::getBackgroundColor public function Get BackgroundColor.
Chart::getHeight public function Get Height.
Chart::getOptions3D public function Get 3D options.
Chart::getPolar public function Get Polar
Chart::getType public function Get Type.
Chart::getWidth public function Get Width.
Chart::jsonSerialize public function Json Serialize.
Chart::setBackgroundColor public function Set BackgroundColor.
Chart::setHeight public function Set Height.
Chart::setOptions3D public function Set 3D options.
Chart::setPolar public function Set Polar.
Chart::setType public function Set Type.
Chart::setWidth public function Set Width.