PHP code example of maddoger / yii2-highcharts

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

    

maddoger / yii2-highcharts example snippets


use maddoger\widgets\Highcharts;

echo Highcharts::widget([
        'chartVariable' => 'cpuChart',
        'options' => [
            'style' => 'width: 100%; height: 400px;',
        ],
        'clientOptions' => [
            'chart' => [
                'type' => 'line',
            ],
            'title' => [
                'text' => 'CPU Usage',
            ],
            'xAxis' => [
                'type' => 'datetime',
                'tickPixelInterval' => 150,
                'maxZoom' => 20 * 2000,
            ],
            'yAxis' => [
                'min' => 0,
                'max' => 100,
                'title' => [
                    'text' => '%',
                ],
            ],
            'series' => [
                [
                    'name'=> 'Core 1',
                    'data'=> [],
                ],
                [
                    'name'=> 'Core 2',
                    'data'=> [],
                ],
            ],
        ],
    ]);

php composer.phar