Files
project/resources/views/components/graph-month.blade.php
2025-02-03 17:09:01 +01:00

31 lines
926 B
PHP

<div class="w-full">
<canvas id="monthly"></canvas>
</div>
<script>
function drawMonth() {
let monthly_invoices = {!! $monthly_invoices !!};
let monthly_incoming = {!! $monthly_incoming !!};
new Chart(
document.getElementById('monthly'),
{
type: 'line',
data: {
datasets: [
{
label: '{{ __('invoice.Invoices') }}',
data: monthly_invoices,
backgroundColor: 'rgb(25,48,90)',
},
{
label: '{{ __('incoming.Incoming') }}',
data: monthly_incoming,
backgroundColor: 'rgb(237,125,35)',
}
]
}
});
}
</script>