PHP code example of luismarto / phpopenchart

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

    

luismarto / phpopenchart example snippets


use Phpopenchart\Chart\Column;

$chart = new Column([
    'chart' => [
        'width' => 1000,
        'height' => 300,
    ],
    'title' => [
        'text' => 'Values'
    ],
    'dataset' => [
        'series' => ['Product A', 'Product B', 'Product C'],
        'labels' => ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
        'data' => [
            [3296, 4852, 2010, 6004, 5014, 7695],
            [2036, 1816, 687, 1025, 3074, 3651],
            [123, 984, 102, 707, 853, 696],
        ]
    ]
]);

$chart->render();


"luismarto/phpopenchart": "3.*"