feat: content recap statistic feat: cooperation completion feat: user statistic feat: website visitor statistic
260 lines
6.7 KiB
PHP
260 lines
6.7 KiB
PHP
<script>
|
|
"use strict";
|
|
|
|
!function (NioApp, $) {
|
|
"use strict";
|
|
|
|
@if(is_role(['1']))
|
|
var airingProofReportStatus = {
|
|
labels: ["Menunggu", "Diterima", "Ditolak"],
|
|
dataUnit: 'Data',
|
|
legend: false,
|
|
datasets: [{
|
|
borderColor: "#fff",
|
|
background: ["#FFCC00", "#0065F8", "#CB0404"],
|
|
data: ["{{$airingProofReportWaiting}}", "{{$airingProofReportAccepted}}", "{{$airingProofReportRejected}}"]
|
|
}]
|
|
};
|
|
|
|
@elseif(is_role(['5']))
|
|
var cooperationCompletionsStatistics = {
|
|
labels: ["Menunggu", "Diterima", "Ditolak"],
|
|
dataUnit: 'Data',
|
|
legend: false,
|
|
datasets: [{
|
|
borderColor: "#fff",
|
|
background: ["#FFB200", "#5CB338", "#E50046"],
|
|
data: ["{{$cooperationCompletionWaiting}}", "{{$cooperationCompletionAccepted}}", "{{$cooperationCompletionRejected}}"]
|
|
}]
|
|
};
|
|
@endif
|
|
|
|
function ecommerceDoughnutS1(selector, set_data) {
|
|
var $selector = selector ? $(selector) : $('.ecommerce-doughnut-s1');
|
|
$selector.each(function () {
|
|
var $self = $(this),
|
|
_self_id = $self.attr('id'),
|
|
_get_data = typeof set_data === 'undefined' ? eval(_self_id) : set_data;
|
|
|
|
var selectCanvas = document.getElementById(_self_id).getContext("2d");
|
|
var chart_data = [];
|
|
|
|
for (var i = 0; i < _get_data.datasets.length; i++) {
|
|
chart_data.push({
|
|
backgroundColor: _get_data.datasets[i].background,
|
|
borderWidth: 2,
|
|
borderColor: _get_data.datasets[i].borderColor,
|
|
hoverBorderColor: _get_data.datasets[i].borderColor,
|
|
data: _get_data.datasets[i].data
|
|
});
|
|
}
|
|
|
|
var chart = new Chart(selectCanvas, {
|
|
type: 'doughnut',
|
|
data: {
|
|
labels: _get_data.labels,
|
|
datasets: chart_data
|
|
},
|
|
options: {
|
|
legend: {
|
|
display: _get_data.legend ? _get_data.legend : false,
|
|
rtl: NioApp.State.isRTL,
|
|
labels: {
|
|
boxWidth: 12,
|
|
padding: 20,
|
|
fontColor: '#6783b8'
|
|
}
|
|
},
|
|
rotation: -1.5,
|
|
cutoutPercentage: 70,
|
|
maintainAspectRatio: false,
|
|
tooltips: {
|
|
enabled: true,
|
|
rtl: NioApp.State.isRTL,
|
|
callbacks: {
|
|
title: function title(tooltipItem, data) {
|
|
return data['labels'][tooltipItem[0]['index']];
|
|
},
|
|
label: function label(tooltipItem, data) {
|
|
return data.datasets[tooltipItem.datasetIndex]['data'][tooltipItem['index']] + ' ' + _get_data.dataUnit;
|
|
}
|
|
},
|
|
backgroundColor: '#1c2b46',
|
|
titleFontSize: 13,
|
|
titleFontColor: '#fff',
|
|
titleMarginBottom: 6,
|
|
bodyFontColor: '#fff',
|
|
bodyFontSize: 12,
|
|
bodySpacing: 4,
|
|
yPadding: 10,
|
|
xPadding: 10,
|
|
footerMarginTop: 0,
|
|
displayColors: false
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} // init chart
|
|
|
|
|
|
NioApp.coms.docReady.push(function () {
|
|
ecommerceDoughnutS1();
|
|
});
|
|
}(NioApp, jQuery);
|
|
</script>
|
|
<script>
|
|
const monthlyStatusData = @json($airingProofReportStatusMonthly);
|
|
|
|
const statusOptions = {
|
|
series: [
|
|
{
|
|
name: 'Menunggu',
|
|
data: monthlyStatusData.waiting
|
|
},
|
|
{
|
|
name: 'Diterima',
|
|
data: monthlyStatusData.accepted
|
|
},
|
|
{
|
|
name: 'Ditolak',
|
|
data: monthlyStatusData.rejected
|
|
}
|
|
],
|
|
colors: ['#FFA500', '#28a745', '#dc3545'],
|
|
chart: {
|
|
type: 'bar',
|
|
height: 350
|
|
},
|
|
plotOptions: {
|
|
bar: {
|
|
horizontal: false,
|
|
columnWidth: '55%',
|
|
borderRadius: 1,
|
|
borderRadiusApplication: 'end'
|
|
},
|
|
},
|
|
dataLabels: {
|
|
enabled: false
|
|
},
|
|
stroke: {
|
|
show: true,
|
|
width: 1,
|
|
colors: ['transparent']
|
|
},
|
|
xaxis: {
|
|
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
labels: {
|
|
show: true,
|
|
rotate: -45,
|
|
style: {
|
|
fontSize: '12px',
|
|
fontFamily: 'Helvetica, Arial, sans-serif',
|
|
}
|
|
}
|
|
},
|
|
yaxis: {
|
|
title: {
|
|
text: 'Status Laporan Bukti Tayang'
|
|
}
|
|
},
|
|
fill: {
|
|
opacity: 1
|
|
},
|
|
tooltip: {
|
|
y: {
|
|
formatter: function (val) {
|
|
return val + " laporan bukti tayang"
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
const statusChart = new ApexCharts(document.querySelector("#airingProofReportColumn"), statusOptions);
|
|
statusChart.render();
|
|
</script>
|
|
<script>
|
|
const monthlyTotalData = @json($airingProofReportPublicationMonthly);
|
|
var publicationOptions = {
|
|
series: [{
|
|
name: 'Publikasi',
|
|
data: monthlyTotalData
|
|
}],
|
|
chart: {
|
|
height: 350,
|
|
type: 'bar',
|
|
},
|
|
plotOptions: {
|
|
bar: {
|
|
borderRadius: 3,
|
|
dataLabels: {
|
|
position: 'center', // top, center, bottom
|
|
},
|
|
}
|
|
},
|
|
dataLabels: {
|
|
enabled: true,
|
|
formatter: function (val) {
|
|
return val + " data";
|
|
},
|
|
offsetY: -20,
|
|
style: {
|
|
fontSize: '12px',
|
|
colors: ["#304758"]
|
|
}
|
|
},
|
|
|
|
xaxis: {
|
|
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
position: 'top',
|
|
axisBorder: {
|
|
show: false
|
|
},
|
|
axisTicks: {
|
|
show: false
|
|
},
|
|
crosshairs: {
|
|
fill: {
|
|
type: 'gradient',
|
|
gradient: {
|
|
colorFrom: '#3572EF',
|
|
colorTo: '#3ABEF9',
|
|
stops: [0, 100],
|
|
opacityFrom: 0.4,
|
|
opacityTo: 0.5,
|
|
}
|
|
}
|
|
},
|
|
tooltip: {
|
|
enabled: true,
|
|
}
|
|
},
|
|
yaxis: {
|
|
axisBorder: {
|
|
show: false
|
|
},
|
|
axisTicks: {
|
|
show: false,
|
|
},
|
|
labels: {
|
|
show: false,
|
|
formatter: function (val) {
|
|
return val + " data";
|
|
}
|
|
}
|
|
|
|
},
|
|
title: {
|
|
text: 'Publikasi Laporan Bukti Tayang',
|
|
floating: true,
|
|
offsetY: 330,
|
|
align: 'center',
|
|
style: {
|
|
color: '#444'
|
|
}
|
|
}
|
|
};
|
|
|
|
var publicationChart = new ApexCharts(document.querySelector("#airingProofReportPublicationColumn"), publicationOptions);
|
|
publicationChart.render();
|
|
</script>
|