Skip to content

Commit

Permalink
Merge pull request #32 from Practically/feat/31
Browse files Browse the repository at this point in the history
feat: add bar chart view template
  • Loading branch information
gwynbox authored Sep 9, 2024
2 parents d3587bc + 61f34b7 commit 27bd7bb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/views/templates/bar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Use of this source is governed by a BSD-style
* licence that can be found in the LICENCE file or at
* https://www.practically.io/copyright/
*
* @copyright 2024 Practically.io. All rights reserved
* @package practically/chartjs
* @since 1.3.0
*
* @var \yii\web\View $this
* @var array $clientOptions
* @var array $dataset
* @var string $id
*/
declare(strict_types=1);

use practically\chartjs\widgets\Chart;

$clientOptions ??= [];
$id ??= 'lineChart';

echo Chart::widget([
'id' => $id,
'datasets' => $dataset,
'type' => Chart::TYPE_BAR,
'clientOptions' => $clientOptions,
]);

0 comments on commit 27bd7bb

Please sign in to comment.