muvo / yii2-amcharts
amCharts widget for Yii2
Installs: 3 018
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/amcharts3: *
- yiisoft/yii2: ^2
This package is not auto-updated.
Last update: 2025-02-01 21:30:42 UTC
README
Install
Case #1
~ $ composer require muvo/yii2-amcharts
Case #2
or add this string into require
section of your composer.json
file:
"muvo/yii2-charts" : "*"
then run
~ $ composer update
Usage
In your view file you can add chart as regular widget, like:
<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,
],
],
],
]) ?>
See also
amCharts official API reference
Credits
Vladislav Muschinskikh i@unixoid.su © 2016