Added Area Chart component and model
This commit is contained in:
36
src/Models/BaseChartModel.php
Normal file
36
src/Models/BaseChartModel.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Asantibanez\LivewireCharts\Models;
|
||||
|
||||
/**
|
||||
* Class BaseChartModel
|
||||
* @package Asantibanez\LivewireCharts\Models
|
||||
*/
|
||||
class BaseChartModel
|
||||
{
|
||||
use HasAxisConfiguration;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setupAxis();
|
||||
}
|
||||
|
||||
public function reactiveKey()
|
||||
{
|
||||
return md5(json_encode($this->toArray()));
|
||||
}
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return [
|
||||
'xAxis' => $this->xAxis,
|
||||
'yAxis' => $this->yAxis,
|
||||
];
|
||||
}
|
||||
|
||||
public function fromArray($array)
|
||||
{
|
||||
$this->setupAxis($array);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user