PHP code example of pringgojs / livewire-charts

1. Go to this page and download the library: Download pringgojs/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/ */

    

pringgojs / livewire-charts example snippets


$legend = ['Category A', 'Category B', 'Category C', 'Category D'];
$series = [
    [
        'name' => 'Series 1',
        'data' => [10, 20, 15, 25],
    ],
    [
        'name' => 'Series 2',
        'data' => [12, 18, 22, 30],
    ],
];

use Pringgojs\LivewireCharts\BarChartComponent;

function updateChart() {
    ...
    $this->dispatch('updateChart', $categories, $series)->to(BarChartComponent::class);
}