muvo / yii2-amcharts
Yii2 的 amCharts 小部件
dev-master
2016-05-03 00:00 UTC
Requires
- bower-asset/amcharts3: *
- yiisoft/yii2: ^2
This package is not auto-updated.
Last update: 2024-09-14 19:20:00 UTC
README
安装
案例 #1
~ $ composer require muvo/yii2-amcharts
案例 #2
或者在您的 composer.json
文件的 require
部分添加此字符串
"muvo/yii2-charts" : "*"
然后运行
~ $ composer update
用法
在您的 视图 文件中,您可以将图表作为常规小部件添加,例如
<h1>Age Graph</h1>
<?= \muvo\yii\amcharts\Chart::widget([
'options' => [ // Here is HTML-parameters of DIV element, which contain chart
'style' => 'height:120px; width: 320px;',
],
'chart' => [ // Here parameters for AmCharts.makeChart()
'type' => 'serial',
'categoryField' => 'name',
'graphs' => [
[
'title' => 'Age',
'type' => 'column',
'valueField' => 'age',
'fillAlphas' => 0.75,
],
],
'dataProvider' => [
[
'name' => 'Alice',
'age' => 19,
],
[
'name' => 'Bob',
'age' => 21,
],
[
'name' => 'Claire',
'age' => 35,
],
],
],
]) ?>
另请参阅
致谢
Владислав Мушинский i@unixoid.su © 2016