Make dashboard configurable.
This commit is contained in:
34
resources/views/components/dashboard_graph_year.blade.php
Normal file
34
resources/views/components/dashboard_graph_year.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
@if( $yearly_incoming->count() === 0 && $yearly_invoices->count() === 0)
|
||||
<div class="w-full text-center">{{ __('dashboard.No data') }}</div>
|
||||
@else
|
||||
<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,
|
||||
backgroundColor: 'rgb(25,48,90)',
|
||||
},
|
||||
{
|
||||
label: '{{ __('incoming.Incoming') }}',
|
||||
data: yearly_incoming,
|
||||
backgroundColor: 'rgb(237,125,35)',
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endif
|
||||
Reference in New Issue
Block a user