v2 first commit
This commit is contained in:
@ -2,34 +2,35 @@
|
||||
@include('charts::_partials.container.canvas2')
|
||||
@endif
|
||||
|
||||
@push('body_scripts')
|
||||
<script type="text/javascript">
|
||||
var ctx = document.getElementById("{{ $model->id }}")
|
||||
var ctx = document.getElementById("{{ $model->id }}");
|
||||
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: [
|
||||
@foreach($model->labels as $label)
|
||||
"{!! $label !!}",
|
||||
@foreach ($model->labels as $label)
|
||||
"{!! $label !!}",
|
||||
@endforeach
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
@foreach($model->values as $dta)
|
||||
{{ $dta }},
|
||||
@foreach ($model->values as $dta)
|
||||
{{ $dta }},
|
||||
@endforeach
|
||||
],
|
||||
backgroundColor: [
|
||||
@if($model->colors)
|
||||
@foreach($model->colors as $color)
|
||||
"{{ $color }}",
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($model->values as $dta)
|
||||
"{{ sprintf('#%06X', mt_rand(0, 0xFFFFFF)) }}",
|
||||
@endforeach
|
||||
@endif
|
||||
],
|
||||
@if ($model->colors)
|
||||
@foreach ($model->colors as $color)
|
||||
"{{ $color }}",
|
||||
@endforeach
|
||||
@else
|
||||
@foreach ($model->values as $dta)
|
||||
"{{ sprintf('#%06X', mt_rand(0, 0xFFFFFF)) }}",
|
||||
@endforeach
|
||||
@endif
|
||||
]
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
@ -38,7 +39,7 @@
|
||||
legend: {
|
||||
display: true,
|
||||
fullWidth: true,
|
||||
position: 'right',
|
||||
position: 'right'
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
@ -60,13 +61,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
@if($model->title)
|
||||
@if ($model->title)
|
||||
title: {
|
||||
display: true,
|
||||
text: "{!! $model->title !!}",
|
||||
fontSize: 20,
|
||||
fontSize: 20
|
||||
}
|
||||
@endif
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user