Example #1
0
<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
/* @var $this yii\web\View */
/* @var $lineArray array ['x' => array, 'y' => array[[1,2,3,..],...]] Регистрация за один день */
/* @var $lineArray2 array ['x' => array, 'y' => array[[1,2,3,..],...]] Прирост пользователей общий */
$this->title = 'Статистика';
?>
<div class="container">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <h2 class="page-header">Регистрация за один день</h2>
    <?php 
echo \cs\Widget\ChartJs\Bar::widget(['width' => 800, 'lineArray' => $lineArray, 'colors' => [['label' => "My First dataset", 'fillColor' => "rgba(220,220,220,1)", 'strokeColor' => "rgba(220,220,220,1)", 'pointColor' => "rgba(220,220,220,1)", 'pointStrokeColor' => "#fff", 'pointHighlightFill' => "#fff", 'pointHighlightStroke' => "rgba(220,220,220,1)"]]]);
?>
    <h2 class="page-header">Прирост пользователей общий</h2>
    <?php 
echo \cs\Widget\ChartJs\Line::widget(['width' => 800, 'lineArray' => $lineArray2]);
?>

</div>
Example #2
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $item  \app\models\Stock */
$this->title = $item->getField('name');
?>

<h1 class="page-header"><?php 
echo $this->title;
?>
</h1>



<?php 
echo \cs\Widget\ChartJs\Line::widget(['width' => 800, 'lineArray' => \app\service\GraphExporter::convert(['rows' => [\app\models\StockKurs::query(['stock_id' => $item->getId()])->all(), \app\models\StockPrognosis::query(['stock_id' => $item->getId()])->all()]])]);
Example #3
0
<h1 class="page-header"><?php 
echo $this->title;
?>
</h1>

<h2 class="page-header">Прошлое</h2>
<?php 
echo \cs\Widget\ChartJs\Line::widget(['width' => 800, 'lineArray' => $lineArrayPast, 'colors' => [$colorGreen, $colorRed, $colorBlue]]);
?>

<h2 class="page-header">Будущее</h2>
<?php 
if ($isPaid) {
    ?>
    <?php 
    echo \cs\Widget\ChartJs\Line::widget(['width' => 800, 'lineArray' => $lineArrayFuture, 'colors' => [$colorRed, $colorBlue]]);
} else {
    ?>
    <div class="form-group">
        <p><span class="label label-danger">График не оплачен</span></p>
    </div>
    <a
        href="<?php 
    echo Url::to(['cabinet_wallet/add', 'id' => $item->getId()]);
    ?>
"
        class="btn btn-default"
        style="width: 100%"
        >Купить</a>
<?php 
}