Include graph.js and build some dashboard tiles.

This commit is contained in:
2025-02-03 16:58:31 +01:00
parent ade1bfb863
commit 92e9511550
9 changed files with 242 additions and 56 deletions

View File

@@ -0,0 +1,27 @@
<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
},
{
label: '{{ __('incoming.Incoming') }}',
data: monthly_incoming
}
]
}
});
}
</script>

View File

@@ -0,0 +1,27 @@
<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>