%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/resources/views/components/ |
Upload File : |
@php
$valuesTotal = array_sum($values);
@endphp
@if ($valuesTotal > 0)
<div class="m-auto" style="height: {{ $attributes['height'] }}px; width: {{ $attributes['width'] }}px">
<canvas {{ $attributes }}></canvas>
</div>
<script>
var ctx = document.getElementById("{{ $attributes['id'] }}");
var myChart = new Chart(ctx, {
type: 'pie',
data: {
labels: [
@foreach ($labels as $label)
"{{ $label }}",
@endforeach
],
datasets: [
{
label: 'Dataset 1',
data: [
@foreach ($values as $value)
{{ $value }},
@endforeach
],
backgroundColor: [
@foreach ($colors as $color)
"{{ $color }}",
@endforeach
],
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right',
},
title: {
display: false,
text: 'Chart.js Pie Chart'
}
}
},
});
</script>
@else
<div class="text-center text-lightest p-20"
style="height: {{ $attributes['height'] }}px">
<i class="side-icon f-21 bi bi-pie-chart"></i>
<div class="f-15 mt-4">
- @lang('messages.notEnoughData') -
</div>
</div>
@endif