PHP code example of miloschuman / yii-highcharts
1. Go to this page and download the library: Download miloschuman/yii-highcharts 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/ */
miloschuman / yii-highcharts example snippets
$this->Widget('ext.highcharts.HighchartsWidget', array(
'options'=>array(
'title' => array('text' => 'Fruit Consumption'),
'xAxis' => array(
'categories' => array('Apples', 'Bananas', 'Oranges')
),
'yAxis' => array(
'title' => array('text' => 'Fruit eaten')
),
'series' => array(
array('name' => 'Jane', 'data' => array(1, 0, 4)),
array('name' => 'John', 'data' => array(5, 7, 3))
)
)
));
$this->Widget('ext.highcharts.HighchartsWidget', array(
'options'=>'{
"title": { "text": "Fruit Consumption" },
"xAxis": {
"categories": ["Apples", "Bananas", "Oranges"]
},
"yAxis": {
"title": { "text": "Fruit eaten" }
},
"series": [
{ "name": "Jane", "data": [1, 0, 4] },
{ "name": "John", "data": [5, 7,3] }
]
}'
));
...
'tooltip' => array(
'formatter' => 'js:function(){ return this.series.name; }'
),
...
...
'credits' => array('enabled' => false),
...
...
'scripts' => array(
'highcharts-more', // enables supplementary chart types (gauge, arearange, columnrange, etc.)
'modules/exporting', // adds Exporting button/menu to chart
'themes/grid' // applies global 'grid' theme to all charts
),
...