PHP code example of yiier / yii2-chartjs-widget

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

    

yiier / yii2-chartjs-widget example snippets


<?= ChartJs::widget([
    'type' => 'line',
    'options' => [
        'height' => 200,
        'width' => 600
    ],
    'data' => [
        'labels' => ["January", "February", "March", "April", "May", "June", "July"],
         'datasets' => [
             [
                 'label'=> '# of Votes',
                 'data' => [65, 59, 90, 81, 56, 55, 40]
             ],
             [
                 'label'=> '# of Votes',
                 'data' => [28, 48, 40, 19, 96, 27, 100]
             ]
         ]
    ]
]);

php composer.phar