Extracted animated property to trait
This commit is contained in:
@@ -9,12 +9,14 @@ namespace Asantibanez\LivewireCharts\Models;
|
||||
*/
|
||||
class BaseChartModel
|
||||
{
|
||||
use HasAnimation;
|
||||
use HasAxis;
|
||||
use HasStroke;
|
||||
use HasLegend;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->initAnimation();
|
||||
$this->initAxis();
|
||||
$this->initStroke();
|
||||
$this->initLegend();
|
||||
@@ -28,6 +30,7 @@ class BaseChartModel
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(
|
||||
$this->animationToArray(),
|
||||
$this->axisToArray(),
|
||||
$this->strokeToArray(),
|
||||
$this->legendToArray()
|
||||
@@ -36,6 +39,7 @@ class BaseChartModel
|
||||
|
||||
public function fromArray($array)
|
||||
{
|
||||
$this->animationFromArray($array);
|
||||
$this->axisFromArray($array);
|
||||
$this->strokeFromArray($array);
|
||||
$this->legendFromArray($array);
|
||||
|
||||
Reference in New Issue
Block a user