v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -4,30 +4,31 @@
@include('charts::_partials.helpers.hex2rgb')
@push('body_scripts')
<script type="text/javascript">
var ctx = document.getElementById("{{ $model->id }}")
var ctx = document.getElementById("{{ $model->id }}");
var data = {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [{
fill: true,
@if($model->colors)
backgroundColor: hex2rgba_convert("{{ $model->colors[0] }}", 50),
@if ($model->colors)
backgroundColor: hex2rgba_convert("{{ $model->colors[0] }}", 50),
@endif
label: "{!! $model->element_label !!}",
lineTension: 0.3,
@if($model->colors)
borderColor: "{{ $model->colors[0] }}",
@if ($model->colors)
borderColor: "{{ $model->colors[0] }}",
@endif
data: [
@foreach($model->values as $dta)
{{ $dta }},
@foreach ($model->values as $dta)
{{ $dta }},
@endforeach
],
]
}]
};
@ -37,13 +38,14 @@
options: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush

View File

@ -2,56 +2,57 @@
@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: 'bar',
data: {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
{
label: "{!! $model->element_label !!}",
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
],
data: [
@foreach($model->values as $dta)
{{ $dta }},
@endforeach
],
}
]
datasets: [{
label: "{!! $model->element_label !!}",
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
],
data: [
@foreach ($model->values as $dta)
{{ $dta }},
@endforeach
]
}]
},
options: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
fontSize: 20
},
@endif
scales: {
yAxes: [{
display: true,
ticks: {
beginAtZero: true,
beginAtZero: true
}
}]
}
}
});
</script>
@endpush

View File

@ -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

View File

@ -2,30 +2,30 @@
@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 data = {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
{
fill: false,
label: "{!! $model->element_label !!}",
lineTension: 0.3,
@if($model->colors)
borderColor: "{{ $model->colors[0] }}",
backgroundColor: "{{ $model->colors[0] }}",
@endif
data: [
@foreach($model->values as $dta)
{{ $dta }},
@endforeach
],
}
]
datasets: [{
fill: false,
label: "{!! $model->element_label !!}",
lineTension: 0.3,
@if ($model->colors)
borderColor: "{{ $model->colors[0] }}",
backgroundColor: "{{ $model->colors[0] }}",
@endif
data: [
@foreach ($model->values as $dta)
{{ $dta }},
@endforeach
]
}]
};
var myLineChart = new Chart(ctx, {
@ -34,13 +34,14 @@
options: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush

View File

@ -4,34 +4,35 @@
@include('charts::_partials.helpers.hex2rgb')
@push('body_scripts')
<script type="text/javascript">
var ctx = document.getElementById("{{ $model->id }}");
var ctx = document.getElementById("{{ $model->id }}")
var data = {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
@for ($i = 0; $i < count($model->datasets); $i++)
{
fill: true,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if($model->colors and count($model->colors) > $i)
@php($c = $model->colors[$i])
@else
@php($c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)))
@endif
borderColor: "{{ $c }}",
backgroundColor: hex2rgba_convert("{{ $c }}", 50),
data: [
@foreach($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
],
},
{
fill: true,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if ($model->colors and count($model->colors) > $i)
@php $c = $model->colors[$i]; @endphp
@else
@php $c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)); @endphp
@endif
borderColor: "{{ $c }}",
backgroundColor: hex2rgba_convert("{{ $c }}", 50),
data: [
@foreach ($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
]
},
@endfor
]
};
@ -42,15 +43,14 @@
options: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush

View File

@ -2,50 +2,52 @@
@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: 'bar',
data: {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
@for ($i = 0; $i < count($model->datasets); $i++)
{
fill: true,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if($model->colors and count($model->colors) > $i)
borderColor: "{{ $model->colors[$i] }}",
backgroundColor: "{{ $model->colors[$i] }}",
@else
$c = sprintf('#%06X', mt_rand(0, 0xFFFFFF))
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
@endif
data: [
@foreach($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
],
},
{
fill: true,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if ($model->colors and count($model->colors) > $i)
borderColor: "{{ $model->colors[$i] }}",
backgroundColor: "{{ $model->colors[$i] }}",
@else
@php $c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)); @endphp
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
@endif
data: [
@foreach ($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
],
},
@endfor
]
},
options: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
title: {
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
text: "{!! $model->title !!}",
fontSize: 20,
},
@endif
scales: {
scales: {
yAxes: [{
display: true,
ticks: {
@ -56,3 +58,4 @@
}
});
</script>
@endpush

View File

@ -2,33 +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 data = {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
@for ($i = 0; $i < count($model->datasets); $i++)
{
fill: false,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if($model->colors and count($model->colors) > $i)
@php($c = $model->colors[$i])
@else
@php($c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)))
@endif
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
data: [
@foreach($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
],
},
{
fill: false,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if ($model->colors and count($model->colors) > $i)
@php $c = $model->colors[$i]; @endphp
@else
@php $c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)); @endphp
@endif
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
data: [
@foreach ($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
]
},
@endfor
]
};
@ -43,13 +45,14 @@
display: true,
position: 'top'
},
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush

View File

@ -2,33 +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 data = {
labels: [
@foreach($model->labels as $label)
"{!! $label !!}",
@foreach ($model->labels as $label)
"{!! $label !!}",
@endforeach
],
datasets: [
@for ($i = 0; $i < count($model->datasets); $i++)
{
fill: false,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if($model->colors and count($model->colors) > $i)
@php($c = $model->colors[$i])
@else
@php($c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)))
@endif
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
data: [
@foreach($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
],
},
{
fill: false,
label: "{!! $model->datasets[$i]['label'] !!}",
lineTension: 0.3,
@if ($model->colors and count($model->colors) > $i)
@php $c = $model->colors[$i]; @endphp
@else
@php $c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)); @endphp
@endif
borderColor: "{{ $c }}",
backgroundColor: "{{ $c }}",
data: [
@foreach ($model->datasets[$i]['values'] as $dta)
{{ $dta }},
@endforeach
]
},
@endfor
]
};
@ -46,13 +48,14 @@
animation: {
duration: 0
},
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush

View File

@ -2,46 +2,48 @@
@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: 'pie',
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: {
responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
maintainAspectRatio: false,
@if($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20,
}
@if ($model->title)
title: {
display: true,
text: "{!! $model->title !!}",
fontSize: 20
}
@endif
}
});
</script>
@endpush