Added Area Chart component and model

This commit is contained in:
asantibanez
2020-10-20 10:43:04 -05:00
parent 8752a7eff0
commit 1d0755e249
6 changed files with 311 additions and 0 deletions

View 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);
}
}