Add RadarChart
This commit is contained in:
36
src/Charts/LivewireRadarChart.php
Normal file
36
src/Charts/LivewireRadarChart.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Asantibanez\LivewireCharts\Charts;
|
||||
|
||||
use Asantibanez\LivewireCharts\Models\RadarChartModel;
|
||||
use Livewire\Component;
|
||||
|
||||
/**
|
||||
* Class LivewireRadarChart
|
||||
* @package Asantibanez\LivewireCharts\Charts
|
||||
*/
|
||||
class LivewireRadarChart extends Component
|
||||
{
|
||||
public $radarChartModel;
|
||||
|
||||
public function mount(RadarChartModel $radarChartModel)
|
||||
{
|
||||
$this->radarChartModel = $radarChartModel->toArray();
|
||||
}
|
||||
|
||||
public function onPointClick($point)
|
||||
{
|
||||
$onPointClickEventName = data_get($this->radarChartModel, 'onPointClickEventName', null);
|
||||
|
||||
if ($onPointClickEventName === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->emit($onPointClickEventName, $point);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire-charts::livewire-radar-chart');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user