dev-master
9999999-devYii2 Google Chart
BSD-3-Clause
The Requires
yii2 yii 2 google chart
Yii2 Google Chart
http://yii2.kadastrcard.ru/googlechart, (*1)
The extension uses Google library https://www.gstatic.com/charts/loader.js and makes chart from php array of structure defined., (*2)
, (*3)
Install with composer:, (*4)
composer require slavkovrn/yii2-googlechart
or add, (*5)
"slavkovrn/yii2-googlechart": "*"
to the require section of your composer.json
file., (*6)
Set link to extension in your view:, (*7)
use slavkovrn\googlechart\GoogleChartWidget; $data = [ 'SIN' => [ number_format(0,5) => sin(0), number_format(Pi()/4,5) => sin(Pi()/4), number_format(Pi()/2,5) => sin(Pi()/2), number_format(Pi()/2+Pi()/4,5) => sin(Pi()/2+Pi()/4), number_format(Pi(),5) => sin(Pi()), number_format(Pi()+Pi()/4,5) => sin(Pi()+Pi()/4), number_format(Pi()+Pi()/2,5) => sin(Pi()+Pi()/2), number_format(Pi()+Pi()/2+Pi()/4,5) => sin(Pi()+Pi()/2+Pi()/4), number_format(2*Pi(),5) => sin(2*Pi()), ], 'COS' => [ number_format(0,5) => cos(0), number_format(Pi()/4,5) => cos(Pi()/4), number_format(Pi()/2,5) => cos(Pi()/2), number_format(Pi()/2+Pi()/4,5) => cos(Pi()/2+Pi()/4), number_format(Pi(),5) => cos(Pi()), number_format(Pi()+Pi()/4,5) => cos(Pi()+Pi()/4), number_format(Pi()+Pi()/2,5) => cos(Pi()+Pi()/2), number_format(Pi()+Pi()/2+Pi()/4,5) => cos(Pi()+Pi()/2+Pi()/4), number_format(2*Pi(),5) => cos(2*Pi()), ], ]; echo GoogleChartWidget::widget([ 'id' =>'google-chart', 'title' => 'Google Chart', 'style' => 'width:100%', 'data' => $data, ]);
Yii2 Google Chart
BSD-3-Clause
yii2 yii 2 google chart