Extracted title property to trait
This commit is contained in:
@@ -8,13 +8,10 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class LineChartModel
|
||||
* @package Asantibanez\LivewireCharts\Models
|
||||
* @property string $title
|
||||
* @property boolean $isMultiLine
|
||||
*/
|
||||
class LineChartModel extends BaseChartModel
|
||||
{
|
||||
public $title;
|
||||
|
||||
public $isMultiLine;
|
||||
|
||||
public $data;
|
||||
@@ -27,8 +24,6 @@ class LineChartModel extends BaseChartModel
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->title = '';
|
||||
|
||||
$this->isMultiLine = false;
|
||||
|
||||
$this->onPointClickEventName = null;
|
||||
@@ -56,13 +51,6 @@ class LineChartModel extends BaseChartModel
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addPoint($title, $value, $extras = [])
|
||||
{
|
||||
$this->data->push([
|
||||
@@ -119,7 +107,6 @@ class LineChartModel extends BaseChartModel
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(parent::toArray(), [
|
||||
'title' => $this->title,
|
||||
'isMultiLine' => $this->isMultiLine,
|
||||
'onPointClickEventName' => $this->onPointClickEventName,
|
||||
'data' => $this->data->toArray(),
|
||||
@@ -131,8 +118,6 @@ class LineChartModel extends BaseChartModel
|
||||
{
|
||||
parent::fromArray($array);
|
||||
|
||||
$this->title = data_get($array, 'title', '');
|
||||
|
||||
$this->isMultiLine = data_get($array, 'isMultiLine', false);
|
||||
|
||||
$this->onPointClickEventName = data_get($array, 'onPointClickEventName', null);
|
||||
|
||||
Reference in New Issue
Block a user