iluxaar / yii2-highcharts
Yii2 Highcharts
dev-master
2016-10-30 16:09 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-28 20:08:59 UTC
README
Yii2 Highcharts
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist iluxaar/yii2-highcharts "*"
或添加
"iluxaar/yii2-highcharts": "*"
到您的 composer.json
文件的 require 部分。
使用方法
安装扩展后,只需在代码中通过以下方式使用它
<?= \iluxaar\highcharts\HighChart::widget([ 'clientOptions' => [ 'chart' => [ 'type' => 'column', ], 'title' => [ 'text' => 'Monthly Average Rainfall', ], 'subtitle' => [ 'text' => 'Source: WorldClimate.com', ], 'yAxis' => [ 'title' => [ 'text' => 'Rainfall (mm)', ], ], 'xAxis' => [ 'categories' => ['Jan', 'Feb', 'Mar'], ], 'series' => [ ['name' => 'Tokyo', 'data' => [49.9, 71.5, 106.4]], ['name' => 'New York', 'data' => [83.6, 78.8, 98.5]], ['name' => 'London', 'data' => [48.9, 38.8, 39.3]], ], ], ]); ?>