Extracted title property to trait
This commit is contained in:
@@ -9,8 +9,6 @@ namespace Asantibanez\LivewireCharts\Models;
|
||||
*/
|
||||
class AreaChartModel extends BaseChartModel
|
||||
{
|
||||
public $title;
|
||||
|
||||
public $color;
|
||||
|
||||
public $data;
|
||||
@@ -21,8 +19,6 @@ class AreaChartModel extends BaseChartModel
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->title = '';
|
||||
|
||||
$this->color = '#90cdf4';
|
||||
|
||||
$this->onPointClickEventName = null;
|
||||
@@ -30,13 +26,6 @@ class AreaChartModel extends BaseChartModel
|
||||
$this->data = collect();
|
||||
}
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setColor($color)
|
||||
{
|
||||
$this->color = $color;
|
||||
@@ -65,7 +54,6 @@ class AreaChartModel extends BaseChartModel
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(parent::toArray(), [
|
||||
'title' => $this->title,
|
||||
'color' => $this->color,
|
||||
'onPointClickEventName' => $this->onPointClickEventName,
|
||||
'data' => $this->data->toArray(),
|
||||
@@ -76,8 +64,6 @@ class AreaChartModel extends BaseChartModel
|
||||
{
|
||||
parent::fromArray($array);
|
||||
|
||||
$this->title = data_get($array, 'title', '');
|
||||
|
||||
$this->color = data_get($array, 'color', '#90cdf4');
|
||||
|
||||
$this->onPointClickEventName = data_get($array, 'onPointClickEventName', null);
|
||||
|
||||
Reference in New Issue
Block a user