Extracted animated property to trait

This commit is contained in:
Andrés Santibáñez
2020-11-03 07:10:30 -05:00
parent 71e2168b6c
commit 5e7cabfd16
5 changed files with 43 additions and 42 deletions

View File

@@ -11,8 +11,6 @@ class ColumnChartModel extends BaseChartModel
{
public $title;
public $animated;
public $opacity;
public $onColumnClickEventName;
@@ -25,8 +23,6 @@ class ColumnChartModel extends BaseChartModel
$this->title = '';
$this->animated = false;
$this->onColumnClickEventName = null;
$this->opacity = 0.5;
@@ -41,13 +37,6 @@ class ColumnChartModel extends BaseChartModel
return $this;
}
public function setAnimated($animated)
{
$this->animated = $animated;
return $this;
}
public function setOpacity($opacity)
{
$this->opacity = $opacity;
@@ -78,7 +67,6 @@ class ColumnChartModel extends BaseChartModel
{
return array_merge(parent::toArray(), [
'title' => $this->title,
'animated' => $this->animated,
'onColumnClickEventName' => $this->onColumnClickEventName,
'opacity' => $this->opacity,
'data' => $this->data->toArray(),
@@ -91,8 +79,6 @@ class ColumnChartModel extends BaseChartModel
$this->title = data_get($array, 'title', '');
$this->animated = data_get($array, 'animated', false);
$this->onColumnClickEventName = data_get($array, 'onColumnClickEventName', null);
$this->opacity = data_get($array, 'opacity', 0.5);