dev-master
9999999-dev https://github.com/mitrm/yii2-amchartsYii2 extension for amcharts.com
MIT
The Requires
- php >=5.4.0
- yiisoft/yii2 *
by Mitskevich Ruslan
yii2 charts amcharts
Wallogit.com
2017 © Pedro Peláez
Yii2 extension for amcharts.com
http://www.amcharts.com/, (*1)
To install, either run, (*2)
$ php composer.phar require --prefer-dist mitrm/yii2-amcharts "dev-master"
or add, (*3)
"mitrm/yii2-amcharts": "dev-master"
Example: Displays a pie, (*4)
$chartConfiguration = [
'dataProvider' => [
['author' => 'Вася', 'title' => 'Васильев Вася', 'count' => 5],
['author' => 'Олег', 'title' => 'Васильев Олег', 'count' => 15],
],
'type' => 'pie',
'legend' => [
'markerType' => 'circle',
'position' => 'right',
'marginRight' => 30,
'autoMargins' => false,
'labelWidth' => 310,
'labelText' => '[[title]]',
'valueText' => '[[value]] ([[percents]]%)',
'width' => 390,
],
'maxLabelWidth' => 150,
'marginLeft' => -100,
'marginTop' => 0,
'marginBottom' => 0,
'labelText' => '[[value]] ([[percents]]%)',
'valueField' => 'count',
'titleField' => 'title',
'descriptionField' => 'author',
'balloonText' => '[[title]]<br><span style=\'font-size:12px\'><b>[[value]]</b> ([[percents]]%)</span>',
];
echo mitrm\amcharts\AmChart::widget([
'chartConfiguration' => $chartConfiguration,
'options' => ['id' => 'chart_id'],
'width' => '100%',
'language' => 'ru',
]);
Yii2 extension for amcharts.com
MIT
yii2 charts amcharts