Files
project/resources/views/components/graph-year.blade.php

28 lines
775 B
PHP

<div class="w-full">
<canvas id="yearly"></canvas>
</div>
<script>
function drawYear() {
let yearly_invoices = {!! $yearly_invoices !!};
let yearly_incoming = {!! $yearly_incoming !!};
new Chart(document.getElementById('yearly'),
{
type: 'bar',
data: {
datasets: [
{
label: '{{ __('invoice.Invoices') }}',
data: yearly_invoices
},
{
label: '{{ __('incoming.Incoming') }}',
data: yearly_incoming
}
]
}
});
}
</script>