0👍
In first code example you must echo
your widget
echo ChartJs::widget([...]);
or
<?= ChartJs::widget([...]); ?>
For the second code you must first add Chart assets (widget add it itself)
- Chartjs-Javascript count daily occurrencies from a datatable for the creation of a linechart
- Chartjs-Remove empty spaces created by null values in Chart.js
Source:stackexchange.com