Chart.php in Charts 8.3
File
modules/charts_highcharts/src/Settings/Highcharts/Chart.php
View source
<?php
namespace Drupal\charts_highcharts\Settings\Highcharts;
class Chart implements \JsonSerializable {
private $type;
private $width = NULL;
private $height = NULL;
private $backgroundColor;
private $polar = NULL;
private $options3d;
public function getType() {
return $this->type;
}
public function setType($type = '') {
$this->type = $type;
}
public function getWidth() {
return $this->width;
}
public function setWidth($width = NULL) {
if (empty($width)) {
$this->width = NULL;
}
else {
$this->width = (int) $width;
}
}
public function getHeight() {
return $this->height;
}
public function setHeight($height = NULL) {
if (empty($height)) {
$this->height = NULL;
}
else {
$this->height = (int) $height;
}
}
public function getBackgroundColor() {
return $this->backgroundColor;
}
public function setBackgroundColor($backgroundColor) {
$this->backgroundColor = $backgroundColor;
}
public function getPolar() {
return $this->polar;
}
public function setPolar($polar) {
$this->polar = $polar;
}
public function getOptions3D() {
return $this->options3d;
}
public function setOptions3D($options3d) {
$this->options3d = $options3d;
}
public function jsonSerialize() {
$vars = get_object_vars($this);
if ($vars['type'] == 'pie' || $vars['type'] == 'donut') {
unset($vars['x']);
}
return $vars;
}
}