PHP code example of brendt / php-sparkline

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

    

brendt / php-sparkline example snippets


$sparkLine = new SparkLine(1, 2, 5, 10, 2);

$total = $sparkLine->getTotal();

$svg = $sparkLine->make();

$sparkLine = (new SparkLine($days))->withColors('#4285F4', '#31ACF2', '#2BC9F4');

$sparkLine = (new SparkLine($days))->withStrokeWidth(4);

$sparkLine = SparkLine::new($days)->withDimensions(width: 500, height: 100);
bash
composer