|
- <?php
-
-
-
- use dosamigos\chartjs\ChartJs;
- use yii\helpers\Html;
-
- $this->setTitle('Statistiques - Chiffre d\'affaire') ;
- $this->addBreadcrumb('Statistiques (chiffre d\'affaire)') ;
-
- ?>
-
- Affichage :
- <?php
- echo Html::a('Mois',
- ['stats/index', 'year' => $yearCurrent, 'displayBy' => 'month'],
- ['class' => 'btn btn-xs '.(($displayBy == 'month') ? 'btn-primary' : 'btn-default')]).' ';
- echo Html::a('Semaine',
- ['stats/index', 'year' => $yearCurrent, 'displayBy' => 'week'],
- ['class' => 'btn btn-xs '.(($displayBy == 'week') ? 'btn-primary' : 'btn-default')]).' ';
-
- ?>
-
- <br><br>
-
- <?php
- foreach($yearsWithTurnoverArray as $year) {
- $classBtn = 'btn-default';
- if($yearCurrent == $year) {
- $classBtn = 'btn-primary';
- }
- echo Html::a($year, ['stats/index', 'year' => $year, 'displayBy' => $displayBy], ['class' => 'btn '.$classBtn]).' ';
- }
- ?>
-
- <?= ChartJs::widget([
- 'type' => 'line',
- 'options' => [
- 'height' => 400,
- 'width' => 1100
- ],
- 'data' => [
- 'labels' => $dataLabels,
- 'datasets' => [
- [
- 'label' => 'Recettes commandes',
- 'backgroundColor' => "rgb(255,127,0,0.5)",
- 'borderColor' => "rgb(255,127,0,1)",
- 'pointBackgroundColor' => "rgb(255,127,0,1)",
- 'pointStrokeColor' => "#fff",
- 'data' => $data
- ]
- ]
- ]
- ]);
-
- ?>
|