PHP code example of jringeisen / wirecharts

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

    

jringeisen / wirecharts example snippets


composer 

<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>

php artisan vendor:publish --provider="Jringeisen\WireCharts\WireChartsServiceProvider" --tag="views"

@livewire('line-chart', ['chartId' => '1', 'title' => 'Daily Users', 'series' => $data1, 'height' => 'h-36'])

@livewire('line-chart', ['chartId' => '1', 'title' => 'Daily Users', 'series' => $data1, 'height' => 'h-36'])
@livewire('line-chart', ['chartId' => '2', 'title' => 'Unique Visitors', 'series' => $data2, 'height' => 'h-36'])

$data1 = [
    'count' => 100,
    'data' => [
        ['meta' => '2021-01-01', 'value' => 5],
        ['meta' => '2021-01-02', 'value' => 4],
        ['meta' => '2021-01-03', 'value' => 1]
    ]
]