PHP code example of jaxon-php / jaxon-flot

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

    

jaxon-php / jaxon-flot example snippets


    $card = $response->flot->card('flot-container');

    $graph = $card->graph(['label' => 'Flot example', 'lines' => ['show' => true]]);

    $graph->series()->points([[0, 3], [4, 8], [8, 5], [9, 13]]);

    $graph->series()->loop(0, 14, 0.5, 'Math.sqrt');

    $card->xaxis()->options([
        // First X axis options.
    ])->points($ticks);
    $card->xaxis()->options([
        // Second X axis options.
    ])->loop(0, 16, 1, 'flot.xaxis.label');

    $card->width('600px')->height('300px');

    $response->flot->draw($card);

jaxon()->di()->g(FlotPlugin::class)->usePie(true);

    $card = $response->flot->card('flot-container');

    $card->options([
        'series' => [
            'pie' => [
                'show' => true,
            ],
        ],
    ]);

    $card->pie()->slices([
        [3, 'Pt 1'],
        [8, 'Pt 2'],
        [5, 'Pt 3'],
        [13, 'Pt 4'],
    ]);

    $response->flot->draw($card);
json
""jaxon-php/jaxon-flot": "^5.1"
}