jambtc/yii2-gchart-as-image

Render Google chart as image

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:yii2-extension

dev-main 2022-12-21 14:35 UTC

This package is auto-updated.

Last update: 2024-05-21 17:46:01 UTC


README

Render Google chart as image

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require jambtc/yii2-gchart-as-image "dev-master"

or add

"jambtc/yii2-gchart-as-image": "dev-master"

to the require section of your composer.json file.

Usage

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

You also can refer to https://developers.google.com/chart/interactive/docs/quick_start

    <div class="col-sm-5">
            <?php
            use jambtc\googlechart\GoogleChart;
    
            echo GoogleChart::widget(['visualization' => 'PieChart',
                'asImage' => true, // render as Image
                'data' => [
                    ['Task', 'Hours per Day'],
                    ['Work', 11],
                    ['Eat', 2],
                    ['Commute', 2],
                    ['Watch TV', 2],
                    ['Sleep', 7]
                ],
                'options' => ['title' => 'My Daily Activity']
            ]);
            
            ?>
        </div>