nickon / yii2-charts
Yii2 FusionCharts manager
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Type:yii2-module
Requires
- php: >=5.5.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-03-15 02:07:43 UTC
README
Instalation
composer require nickon/yii2-charts
Edit config/main.php
return [ 'modules' => [ ... 'charts' => [ 'class' => 'nickon\yii2_charts\Module', ], ] ... ]
Usage
echo \nickon\yii2_charts\widgets\Charts::widget([ 'settings' => [ 'chart_id' => 1, 'dates' => [ [ 'label' => 'Сегодня', 'type' => Charts::DATES_TODAY, 'field' => 'date' ], [ 'label' => 'Вчера', 'type' => Charts::DATES_YESTERDAY, 'field' => 'date' ], [ 'label' => 'Неделя', 'type' => Charts::DATES_WEEK, 'field' => 'date' ], [ 'label' => 'С начала недели', 'type' => Charts::DATES_FROM_WEEK, 'field' => 'date' ], [ 'label' => 'Последний месяц', 'type' => Charts::DATES_MONTH, 'field' => 'date' ], [ 'label' => 'С начала месяца', 'type' => Charts::DATES_FROM_MONTH, 'field' => 'date' ], [ 'label' => 'За последний год', 'type' => Charts::DATES_YEAR, 'field' => 'date' ], [ 'label' => 'С начала года', 'type' => Charts::DATES_FROM_YEAR, 'field' => 'date' ], [ 'label' => 'За всё время', 'type' => Charts::DATES_ALL_TIME, 'field' => 'date' ], [ 'label' => 'Произвольный интервал', 'type' => Charts::DATES_INTERVAL, 'field' => 'date' ], ] ] ]);