PHP code example of fruppel / yii2-googlecharts

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

    

fruppel / yii2-googlecharts example snippets



use \fruppel\googlecharts\GoogleCharts;
...


use \fruppel\googlecharts\GoogleCharts;
...
<?= GoogleCharts::widget([
	'visualization' => 'AreaChart',
		'options' => [
			'title' => 'Company Performance',
			'hAxis' => [
				'title' => 'Year',
				'titleTextStyle' => [
					'color' => '#333'
				]
			],
			'vAxis' => [
				'minValue' => 0
			]
		],
	'dataArray' => [
	        ['Year', 'Sales', 'Expenses'],
	        ['2013',  1000,      400],
	        ['2014',  1170,      460],
	        ['2015',  660,       1120],
	        ['2016',  1030,      540]
	]
])

<?= GoogleCharts::widget([
	'asPng' => true,
	...