yiier/yii2-chartjs-widget

ChartJs 2 for Yii2 widget

Installs: 7 962

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

v1.3 2018-05-04 06:47 UTC

This package is auto-updated.

Last update: 2024-10-25 23:30:58 UTC


README

ChartJs 2 for Yii2 widget

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiier/yii2-chartjs-widget "*"

or add

"yiier/yii2-chartjs-widget": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= 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]
             ]
         ]
    ]
]);?>

Credits

2amigos/yii2-chartjs-widget