dev-master
9999999-devamCharts widget for Yii2
BSD-3-Clause
The Requires
- yiisoft/yii2 ^2
- bower-asset/amcharts3 *
by Vladislav Muschinskikh
yii2 widget charts amcharts
Wallogit.com
2017 © Pedro Peláez
amCharts widget for Yii2
~ $ composer require muvo/yii2-amcharts
or add this string into require section of your composer.json file:, (*1)
"muvo/yii2-charts" : "*"
then run, (*2)
~ $ composer update
In your view file you can add chart as regular widget, like:, (*3)
<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,
],
],
],
]) ?>
amCharts official API reference, (*4)
Vladislav Muschinskikh i@unixoid.su © 2016, (*5)
amCharts widget for Yii2
BSD-3-Clause
yii2 widget charts amcharts