1. Go to this page and download the library: Download hamoi1/livewire-charts library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hamoi1 / livewire-charts example snippets
use Hamoi1\LivewireCharts\Models\ColumnChartModel;
$columnChartModel =
(new ColumnChartModel())
->setTitle('Expenses by Type')
->addColumn('Food', 100, '#f6ad55')
->addColumn('Shopping', 200, '#fc8181')
->addColumn('Travel', 300, '#90cdf4')
;
use Hamoi1\LivewireCharts\Facades\LivewireCharts;
LivewireCharts::lineChartModel();
LivewireCharts::multiLineChartModel();
LivewireCharts::columnChartModel();
LivewireCharts::multiColumnChartModel();
LivewireCharts::pieChartModel();
LivewireCharts::areaChartModel();
LivewireCharts::radarChartModel();
LivewireCharts::treeMapChartModel();
use Hamoi1\LivewireCharts\Models\ColumnChartModel;
$columnChartModel =
(new ColumnChartModel())
->setTitle('Expenses by Type')
->withOnColumnClickEventName('onColumnClick')
;
#[On('onColumnClick')]
public function handleOnColumnClick($event)
{
// Handle event
}