Extracted title property to trait
This commit is contained in:
@@ -9,8 +9,6 @@ namespace Asantibanez\LivewireCharts\Models;
|
||||
*/
|
||||
class PieChartModel extends BaseChartModel
|
||||
{
|
||||
public $title;
|
||||
|
||||
public $onSliceClickEventName;
|
||||
|
||||
public $opacity;
|
||||
@@ -21,8 +19,6 @@ class PieChartModel extends BaseChartModel
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->title = '';
|
||||
|
||||
$this->onSliceClickEventName = null;
|
||||
|
||||
$this->opacity = 0.75;
|
||||
@@ -30,13 +26,6 @@ class PieChartModel extends BaseChartModel
|
||||
$this->data = collect();
|
||||
}
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setOpacity($opacity)
|
||||
{
|
||||
$this->opacity = $opacity;
|
||||
@@ -66,7 +55,6 @@ class PieChartModel extends BaseChartModel
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(parent::toArray(), [
|
||||
'title' => $this->title,
|
||||
'onSliceClickEventName' => $this->onSliceClickEventName,
|
||||
'opacity' => $this->opacity,
|
||||
'data' => $this->data->toArray(),
|
||||
@@ -77,8 +65,6 @@ class PieChartModel extends BaseChartModel
|
||||
{
|
||||
parent::fromArray($array);
|
||||
|
||||
$this->title = data_get($array, 'title', '');
|
||||
|
||||
$this->onSliceClickEventName = data_get($array, 'onSliceClickEventName', null);
|
||||
|
||||
$this->opacity = data_get($array, 'opacity', 0.75);
|
||||
|
||||
Reference in New Issue
Block a user