PHP code example of systonia / waypoint-charts

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

    

systonia / waypoint-charts example snippets


$app->plugin(new Waypoint\Charts\ChartsPlugin());   // before attach()

use Waypoint\Charts\Chart;

$revenue = Chart::fromRows($this->sales->revenueByDay(28, $locale), x: 'day', y: 'revenue')
    ->title('Revenue per day, last four weeks')
    ->unit('€');

$products = Chart::fromRows($this->sales->topProducts(28, $locale), x: 'product', y: 'quantity')
    ->title('Sold in the last four weeks')
    ->size(640, 280);