Skip to content

Commit 61f34b7

Browse files
committed
feat: add bar chart view template
Refs: #31
1 parent d3587bc commit 61f34b7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/views/templates/bar.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Use of this source is governed by a BSD-style
4+
* licence that can be found in the LICENCE file or at
5+
* https://www.practically.io/copyright/
6+
*
7+
* @copyright 2024 Practically.io. All rights reserved
8+
* @package practically/chartjs
9+
* @since 1.3.0
10+
*
11+
* @var \yii\web\View $this
12+
* @var array $clientOptions
13+
* @var array $dataset
14+
* @var string $id
15+
*/
16+
declare(strict_types=1);
17+
18+
use practically\chartjs\widgets\Chart;
19+
20+
$clientOptions ??= [];
21+
$id ??= 'lineChart';
22+
23+
echo Chart::widget([
24+
'id' => $id,
25+
'datasets' => $dataset,
26+
'type' => Chart::TYPE_BAR,
27+
'clientOptions' => $clientOptions,
28+
]);

0 commit comments

Comments
 (0)