feat: add media monitoring and issue management in overview
This commit is contained in:
parent
8798e2b2c2
commit
5da913d677
@ -12,18 +12,21 @@
|
|||||||
use App\Models\MediaOrder;
|
use App\Models\MediaOrder;
|
||||||
use App\Models\Order;
|
use App\Models\Order;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class OverviewController extends Controller
|
class OverviewController extends Controller
|
||||||
{
|
{
|
||||||
public function index(){
|
public function index(Request $request){
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'title' => 'Ikhtisar'
|
'title' => 'Ikhtisar'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$year = $request->input('year') ? $request->input('year') : Carbon::now()->year;
|
||||||
|
|
||||||
if(is_role(['3'])){
|
if(is_role(['3'])){
|
||||||
$mediaId = Auth::user()->company->media->id;
|
$mediaId = Auth::user()->company->media->id;
|
||||||
$media = Media::with('cooperations')->findOrFail($mediaId);
|
$media = Media::with('cooperations')->findOrFail($mediaId);
|
||||||
@ -108,6 +111,35 @@ public function index(){
|
|||||||
$data['cetakContentRecap'] = $contentRecapCount->get('cetak', 0);
|
$data['cetakContentRecap'] = $contentRecapCount->get('cetak', 0);
|
||||||
// Akhir Statistik Rekap Konten
|
// Akhir Statistik Rekap Konten
|
||||||
|
|
||||||
|
// Inisialisasi array 12 bulan (0-11)
|
||||||
|
$mediaMonitoringMonthly = array_fill(0, 12, 0);
|
||||||
|
$issueManagementMonthly = array_fill(0, 12, 0);
|
||||||
|
|
||||||
|
// Media Monitoring
|
||||||
|
$mediaMonitorings = DB::table('media_monitorings')
|
||||||
|
->whereYear('created_at', $year)
|
||||||
|
->selectRaw('MONTH(created_at) as month, COUNT(*) as total')
|
||||||
|
->groupBy('month')
|
||||||
|
->pluck('total', 'month');
|
||||||
|
|
||||||
|
foreach ($mediaMonitorings as $month => $total) {
|
||||||
|
$mediaMonitoringMonthly[$month - 1] = $total;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Issue Management
|
||||||
|
$issueManagements = DB::table('issue_managements')
|
||||||
|
->whereYear('created_at', $year)
|
||||||
|
->selectRaw('MONTH(created_at) as month, COUNT(*) as total')
|
||||||
|
->groupBy('month')
|
||||||
|
->pluck('total', 'month');
|
||||||
|
|
||||||
|
foreach ($issueManagements as $month => $total) {
|
||||||
|
$issueManagementMonthly[$month - 1] = $total;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['mediaMonitoringMonthly'] = $mediaMonitoringMonthly;
|
||||||
|
$data['issueManagementMonthly'] = $issueManagementMonthly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Data kalender pengajuan kerjasama
|
// Data kalender pengajuan kerjasama
|
||||||
|
|||||||
@ -56,11 +56,11 @@
|
|||||||
<th>Tanggal Input</th>
|
<th>Tanggal Input</th>
|
||||||
<th style="width: 30% !important;">Judul</th>
|
<th style="width: 30% !important;">Judul</th>
|
||||||
<th>Media</th>
|
<th>Media</th>
|
||||||
|
<th>Issue</th>
|
||||||
<th>Kanal</th>
|
<th>Kanal</th>
|
||||||
<th>Tema</th>
|
<th>Tema</th>
|
||||||
<th>Penulis</th>
|
<th>Penulis</th>
|
||||||
<th>Link</th>
|
<th>Link</th>
|
||||||
<th>Issue</th>
|
|
||||||
<th style="width: 10% !important;"></th>
|
<th style="width: 10% !important;"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="news_title">Judul</label>
|
<label class="form-label" for="news_title">Judul</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="text" class="form-control" id="news_title" placeholder="Cari..." name="news_title" value="{{ old('news_title') }}">
|
<input type="text" class="form-control" id="news_title" placeholder="Contoh: Pemkab Purwakarta" name="news_title" value="{{ old('news_title') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -115,13 +115,13 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="keyword">Kata Kunci</label>
|
<label class="form-label" for="keyword">Kata Kunci</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="text" class="form-control" id="keyword" placeholder="Cari..." name="keyword" value="{{ old('keyword') }}">
|
<input type="text" class="form-control" id="keyword" placeholder="Contoh: Purwakarta" name="keyword" value="{{ old('keyword') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="input_year">Tahun Input</label>
|
<label class="form-label" for="input_year">Tahun Input</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="number" class="form-control" id="input_year" placeholder="Data monitoring media pada tahun" name="input_year">
|
<input type="number" class="form-control" id="input_year" placeholder="Contoh: 2025" name="input_year">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -139,7 +139,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="release_year">Tahun Rilis</label>
|
<label class="form-label" for="release_year">Tahun Rilis</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="number" class="form-control" id="release_year" placeholder="Data monitoring media pada tahun" name="release_year">
|
<input type="number" class="form-control" id="release_year" placeholder="Contoh: 2025" name="release_year">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="news_title">Judul</label>
|
<label class="form-label" for="news_title">Judul</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="text" class="form-control" id="news_title" placeholder="Cari..." name="news_title" value="{{ old('news_title', $news_title ?? '') }}">
|
<input type="text" class="form-control" id="news_title" placeholder="Contoh: Pemkab Purwakarta" name="news_title" value="{{ old('news_title', $news_title ?? '') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -210,13 +210,13 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="keyword">Kata Kunci</label>
|
<label class="form-label" for="keyword">Kata Kunci</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="text" class="form-control" id="keyword" placeholder="Cari..." name="keyword" value="{{ $keyword }}">
|
<input type="text" class="form-control" id="keyword" placeholder="Contoh: Purwakarta" name="keyword" value="{{ $keyword }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="input_year">Tahun Input</label>
|
<label class="form-label" for="input_year">Tahun Input</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="number" class="form-control" id="input_year" placeholder="Data berita pada tahun" name="input_year" value="{{ old('input_year', $input_year ?? '') }}">
|
<input type="number" class="form-control" id="input_year" placeholder="Contoh: 2025" name="input_year" value="{{ old('input_year', $input_year ?? '') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -234,7 +234,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="release_year">Tahun Rilis</label>
|
<label class="form-label" for="release_year">Tahun Rilis</label>
|
||||||
<div class="form-control-wrap">
|
<div class="form-control-wrap">
|
||||||
<input type="number" class="form-control" id="release_year" placeholder="Data berita pada tahun" name="release_year" value="{{ old('release_year', $release_year ?? '') }}">
|
<input type="number" class="form-control" id="release_year" placeholder="Contoh: 2025" name="release_year" value="{{ old('release_year', $release_year ?? '') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@ -0,0 +1,147 @@
|
|||||||
|
<script>
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
!function (NioApp, $) {
|
||||||
|
"use strict"; //////// for developer - barchart ////////
|
||||||
|
// Avilable options to pass from outside
|
||||||
|
// labels: array,
|
||||||
|
// stacked: false - boolean,
|
||||||
|
// legend: false - boolean,
|
||||||
|
// dataUnit: string, (Used in tooltip or other section for display)
|
||||||
|
// datasets: [{label : string, color: string (color code with # or other format), data: array}]
|
||||||
|
|
||||||
|
var barChartData = {
|
||||||
|
labels: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"],
|
||||||
|
dataUnit: 'People',
|
||||||
|
datasets: [{
|
||||||
|
label: "join",
|
||||||
|
color: "#b695ff",
|
||||||
|
data: [110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 75, 90]
|
||||||
|
}, {
|
||||||
|
label: "join",
|
||||||
|
color: "#b695ff",
|
||||||
|
data: [110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 110, 80, 125, 55, 95, 75, 90, 75, 90]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
var barChartMultiple = {
|
||||||
|
labels: ["Jan", "Feb", "Mar", "Apr", "Mey", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||||
|
dataUnit: 'Data',
|
||||||
|
datasets: [{
|
||||||
|
label: "Monitoring Media",
|
||||||
|
color: "#3ABEF9",
|
||||||
|
data: @json($mediaMonitoringMonthly)
|
||||||
|
}, {
|
||||||
|
label: "Manajemen Isu",
|
||||||
|
color: "#FFEB00",
|
||||||
|
data: @json($issueManagementMonthly)
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
function barChart(selector, set_data) {
|
||||||
|
var $selector = selector ? $(selector) : $('.bar-chart');
|
||||||
|
$selector.each(function () {
|
||||||
|
var $self = $(this),
|
||||||
|
_self_id = $self.attr('id'),
|
||||||
|
_get_data = typeof set_data === 'undefined' ? eval(_self_id) : set_data,
|
||||||
|
_d_legend = typeof _get_data.legend === 'undefined' ? false : _get_data.legend;
|
||||||
|
|
||||||
|
var selectCanvas = document.getElementById(_self_id).getContext("2d");
|
||||||
|
var chart_data = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < _get_data.datasets.length; i++) {
|
||||||
|
chart_data.push({
|
||||||
|
label: _get_data.datasets[i].label,
|
||||||
|
data: _get_data.datasets[i].data,
|
||||||
|
// Styles
|
||||||
|
backgroundColor: _get_data.datasets[i].color,
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: 'transparent',
|
||||||
|
hoverBorderColor: 'transparent',
|
||||||
|
borderSkipped: 'bottom',
|
||||||
|
barPercentage: .6,
|
||||||
|
categoryPercentage: .7
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var chart = new Chart(selectCanvas, {
|
||||||
|
type: 'bar',
|
||||||
|
data: {
|
||||||
|
labels: _get_data.labels,
|
||||||
|
datasets: chart_data
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
legend: {
|
||||||
|
display: _get_data.legend ? _get_data.legend : false,
|
||||||
|
rtl: NioApp.State.isRTL,
|
||||||
|
labels: {
|
||||||
|
boxWidth: 30,
|
||||||
|
padding: 20,
|
||||||
|
fontColor: '#6783b8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
tooltips: {
|
||||||
|
enabled: true,
|
||||||
|
rtl: NioApp.State.isRTL,
|
||||||
|
callbacks: {
|
||||||
|
title: function title(tooltipItem, data) {
|
||||||
|
return data.datasets[tooltipItem[0].datasetIndex].label;
|
||||||
|
},
|
||||||
|
label: function label(tooltipItem, data) {
|
||||||
|
return data.datasets[tooltipItem.datasetIndex]['data'][tooltipItem['index']] + ' ' + _get_data.dataUnit;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
backgroundColor: '#eff6ff',
|
||||||
|
titleFontSize: 13,
|
||||||
|
titleFontColor: '#6783b8',
|
||||||
|
titleMarginBottom: 6,
|
||||||
|
bodyFontColor: '#9eaecf',
|
||||||
|
bodyFontSize: 12,
|
||||||
|
bodySpacing: 4,
|
||||||
|
yPadding: 10,
|
||||||
|
xPadding: 10,
|
||||||
|
footerMarginTop: 0,
|
||||||
|
displayColors: false
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
yAxes: [{
|
||||||
|
display: true,
|
||||||
|
stacked: _get_data.stacked ? _get_data.stacked : false,
|
||||||
|
position: NioApp.State.isRTL ? "right" : "left",
|
||||||
|
ticks: {
|
||||||
|
beginAtZero: true,
|
||||||
|
fontSize: 12,
|
||||||
|
fontColor: '#9eaecf'
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
color: NioApp.hexRGB("#526484", .2),
|
||||||
|
tickMarkLength: 0,
|
||||||
|
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
xAxes: [{
|
||||||
|
display: true,
|
||||||
|
stacked: _get_data.stacked ? _get_data.stacked : false,
|
||||||
|
ticks: {
|
||||||
|
fontSize: 12,
|
||||||
|
fontColor: '#9eaecf',
|
||||||
|
source: 'auto',
|
||||||
|
reverse: NioApp.State.isRTL
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
color: "transparent",
|
||||||
|
tickMarkLength: 10,
|
||||||
|
zeroLineColor: 'transparent'
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} // init bar chart
|
||||||
|
|
||||||
|
|
||||||
|
barChart(); //////// for developer - linechart ////////
|
||||||
|
|
||||||
|
}(NioApp, jQuery);
|
||||||
|
</script>
|
||||||
@ -267,6 +267,31 @@
|
|||||||
</div><!-- .card -->
|
</div><!-- .card -->
|
||||||
</div><!-- .col -->
|
</div><!-- .col -->
|
||||||
@endif
|
@endif
|
||||||
|
<div class="col-xxl-3 col-md-12">
|
||||||
|
<div class="card card-full overflow-hidden">
|
||||||
|
<div class="nk-ecwg nk-ecwg7 h-100">
|
||||||
|
<div class="card-inner flex-grow-1">
|
||||||
|
<div class="card-title-group mb-4">
|
||||||
|
<div class="card-title">
|
||||||
|
<h6 class="title">Statistik Monitoring Media dan Manajemen Isu</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="nk-ck">
|
||||||
|
<canvas class="bar-chart" id="barChartMultiple"></canvas>
|
||||||
|
</div>
|
||||||
|
</div><!-- .card-inner -->
|
||||||
|
</div>
|
||||||
|
</div><!-- .card -->
|
||||||
|
</div><!-- .col -->
|
||||||
|
{{-- <div class="col-xxl-3 col-md-12">
|
||||||
|
<div class="card card-bordered card-preview">
|
||||||
|
<div class="card-inner">
|
||||||
|
<div class="nk-ck">
|
||||||
|
<canvas class="bar-chart" id="barChartMultiple"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- .card-preview -->
|
||||||
|
</div><!-- .col --> --}}
|
||||||
</div><!-- .row -->
|
</div><!-- .row -->
|
||||||
</div><!-- .nk-block -->
|
</div><!-- .nk-block -->
|
||||||
@if (!is_role(['5']))
|
@if (!is_role(['5']))
|
||||||
|
|||||||
@ -1195,11 +1195,11 @@
|
|||||||
{ data: 'input_date', name: 'input_date' },
|
{ data: 'input_date', name: 'input_date' },
|
||||||
{ data: 'title', name: 'title' },
|
{ data: 'title', name: 'title' },
|
||||||
{ data: 'media_name', name: 'media_name' },
|
{ data: 'media_name', name: 'media_name' },
|
||||||
|
{ data: 'issue_status', name: 'issue_status' },
|
||||||
{ data: 'channel', name: 'channel' },
|
{ data: 'channel', name: 'channel' },
|
||||||
{ data: 'theme', name: 'theme' },
|
{ data: 'theme', name: 'theme' },
|
||||||
{ data: 'writter', name: 'writter' },
|
{ data: 'writter', name: 'writter' },
|
||||||
{ data: 'link', name: 'link' },
|
{ data: 'link', name: 'link' },
|
||||||
{ data: 'issue_status', name: 'issue_status' },
|
|
||||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||||
{ data: 'created_at', name: 'created_at', visible: false },
|
{ data: 'created_at', name: 'created_at', visible: false },
|
||||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||||
|
|||||||
@ -4,702 +4,6 @@
|
|||||||
!function (NioApp, $) {
|
!function (NioApp, $) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var totalSales = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'Sales',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Sales",
|
|
||||||
color: "#9d72ff",
|
|
||||||
background: NioApp.hexRGB('#9d72ff', .25),
|
|
||||||
data: [130, 105, 125, 115, 110, 95, 131, 110, 115, 120, 111, 97, 113, 107, 122, 100, 85, 110, 130, 107, 90, 105, 123, 115, 100, 117, 125, 95, 137, 101]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
var totalOrders = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'Orders',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Orders",
|
|
||||||
color: "#7de1f8",
|
|
||||||
background: NioApp.hexRGB('#7de1f8', .25),
|
|
||||||
data: [85, 125, 105, 115, 130, 106, 141, 110, 95, 120, 111, 105, 113, 107, 122, 100, 95, 110, 120, 107, 100, 105, 123, 115, 110, 117, 125, 75, 95, 101]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
var totalCustomers = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'Customers',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Customers",
|
|
||||||
color: "#83bcff",
|
|
||||||
background: NioApp.hexRGB('#83bcff', .25),
|
|
||||||
data: [92, 105, 125, 85, 110, 106, 131, 105, 110, 115, 135, 105, 120, 85, 122, 100, 125, 110, 120, 125, 85, 105, 123, 115, 90, 117, 125, 100, 95, 65]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ecommerceLineS1(selector, set_data) {
|
|
||||||
var $selector = selector ? $(selector) : $('.ecommerce-line-chart-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({
|
|
||||||
label: _get_data.datasets[i].label,
|
|
||||||
tension: _get_data.lineTension,
|
|
||||||
backgroundColor: _get_data.datasets[i].background,
|
|
||||||
borderWidth: 2,
|
|
||||||
borderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderColor: 'transparent',
|
|
||||||
pointBackgroundColor: 'transparent',
|
|
||||||
pointHoverBackgroundColor: "#fff",
|
|
||||||
pointHoverBorderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderWidth: 2,
|
|
||||||
pointHoverRadius: 4,
|
|
||||||
pointHoverBorderWidth: 2,
|
|
||||||
pointRadius: 4,
|
|
||||||
pointHitRadius: 4,
|
|
||||||
data: _get_data.datasets[i].data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var chart = new Chart(selectCanvas, {
|
|
||||||
type: 'line',
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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: 10,
|
|
||||||
titleFontColor: '#fff',
|
|
||||||
titleMarginBottom: 4,
|
|
||||||
bodyFontColor: '#fff',
|
|
||||||
bodyFontSize: 10,
|
|
||||||
bodySpacing: 4,
|
|
||||||
yPadding: 6,
|
|
||||||
xPadding: 6,
|
|
||||||
footerMarginTop: 0,
|
|
||||||
displayColors: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: true,
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
padding: 0
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: NioApp.hexRGB("#526484", .2),
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
source: 'auto',
|
|
||||||
padding: 0,
|
|
||||||
reverse: NioApp.State.isRTL
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: "transparent",
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2),
|
|
||||||
offsetGridLines: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} // init chart
|
|
||||||
|
|
||||||
|
|
||||||
NioApp.coms.docReady.push(function () {
|
|
||||||
ecommerceLineS1();
|
|
||||||
});
|
|
||||||
var storeVisitors = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'People',
|
|
||||||
lineTension: .1,
|
|
||||||
datasets: [{
|
|
||||||
label: "Current Month",
|
|
||||||
color: "#9d72ff",
|
|
||||||
dash: 0,
|
|
||||||
background: "transparent",
|
|
||||||
data: [4110, 4220, 4810, 5480, 4600, 5670, 6660, 4830, 5590, 5730, 4790, 4950, 5100, 5800, 5950, 5850, 5950, 4450, 4900, 8000, 7200, 7250, 7900, 8950, 6300, 7200, 7250, 7650, 6950, 4750]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ecommerceLineS2(selector, set_data) {
|
|
||||||
var $selector = selector ? $(selector) : $('.ecommerce-line-chart-s2');
|
|
||||||
$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({
|
|
||||||
label: _get_data.datasets[i].label,
|
|
||||||
tension: _get_data.lineTension,
|
|
||||||
backgroundColor: _get_data.datasets[i].background,
|
|
||||||
borderWidth: 2,
|
|
||||||
borderDash: _get_data.datasets[i].dash,
|
|
||||||
borderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderColor: 'transparent',
|
|
||||||
pointBackgroundColor: 'transparent',
|
|
||||||
pointHoverBackgroundColor: "#fff",
|
|
||||||
pointHoverBorderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderWidth: 2,
|
|
||||||
pointHoverRadius: 4,
|
|
||||||
pointHoverBorderWidth: 2,
|
|
||||||
pointRadius: 4,
|
|
||||||
pointHitRadius: 4,
|
|
||||||
data: _get_data.datasets[i].data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var chart = new Chart(selectCanvas, {
|
|
||||||
type: 'line',
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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']];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
backgroundColor: '#1c2b46',
|
|
||||||
titleFontSize: 13,
|
|
||||||
titleFontColor: '#fff',
|
|
||||||
titleMarginBottom: 6,
|
|
||||||
bodyFontColor: '#fff',
|
|
||||||
bodyFontSize: 12,
|
|
||||||
bodySpacing: 4,
|
|
||||||
yPadding: 10,
|
|
||||||
xPadding: 10,
|
|
||||||
footerMarginTop: 0,
|
|
||||||
displayColors: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
display: true,
|
|
||||||
position: NioApp.State.isRTL ? "right" : "left",
|
|
||||||
ticks: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
padding: 8,
|
|
||||||
stepSize: 2400,
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: NioApp.hexRGB("#526484", .2),
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
source: 'auto',
|
|
||||||
padding: 0,
|
|
||||||
reverse: NioApp.State.isRTL
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: "transparent",
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: 'transparent',
|
|
||||||
offsetGridLines: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} // init chart
|
|
||||||
|
|
||||||
|
|
||||||
NioApp.coms.docReady.push(function () {
|
|
||||||
ecommerceLineS2();
|
|
||||||
});
|
|
||||||
var todayOrders = {
|
|
||||||
labels: ["12AM - 02AM", "02AM - 04AM", "04AM - 06AM", "06AM - 08AM", "08AM - 10AM", "10AM - 12PM", "12PM - 02PM", "02PM - 04PM", "04PM - 06PM", "06PM - 08PM", "08PM - 10PM", "10PM - 12PM"],
|
|
||||||
dataUnit: 'Orders',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Orders",
|
|
||||||
color: "#854fff",
|
|
||||||
background: "transparent",
|
|
||||||
data: [92, 105, 125, 85, 110, 106, 131, 105, 110, 131, 105, 110]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
var todayRevenue = {
|
|
||||||
labels: ["12AM - 02AM", "02AM - 04AM", "04AM - 06AM", "06AM - 08AM", "08AM - 10AM", "10AM - 12PM", "12PM - 02PM", "02PM - 04PM", "04PM - 06PM", "06PM - 08PM", "08PM - 10PM", "10PM - 12PM"],
|
|
||||||
dataUnit: 'Orders',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Revenue",
|
|
||||||
color: "#33d895",
|
|
||||||
background: "transparent",
|
|
||||||
data: [92, 105, 125, 85, 110, 106, 131, 105, 110, 131, 105, 110]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
var todayCustomers = {
|
|
||||||
labels: ["12AM - 02AM", "02AM - 04AM", "04AM - 06AM", "06AM - 08AM", "08AM - 10AM", "10AM - 12PM", "12PM - 02PM", "02PM - 04PM", "04PM - 06PM", "06PM - 08PM", "08PM - 10PM", "10PM - 12PM"],
|
|
||||||
dataUnit: 'Orders',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Customers",
|
|
||||||
color: "#ff63a5",
|
|
||||||
background: "transparent",
|
|
||||||
data: [92, 105, 125, 85, 110, 106, 131, 105, 110, 131, 105, 110]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
var todayVisitors = {
|
|
||||||
labels: ["12AM - 02AM", "02AM - 04AM", "04AM - 06AM", "06AM - 08AM", "08AM - 10AM", "10AM - 12PM", "12PM - 02PM", "02PM - 04PM", "04PM - 06PM", "06PM - 08PM", "08PM - 10PM", "10PM - 12PM"],
|
|
||||||
dataUnit: 'Orders',
|
|
||||||
lineTension: .3,
|
|
||||||
datasets: [{
|
|
||||||
label: "Visitors",
|
|
||||||
color: "#559bfb",
|
|
||||||
background: "transparent",
|
|
||||||
data: [92, 105, 125, 85, 110, 106, 131, 105, 110, 131, 105, 110]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ecommerceLineS3(selector, set_data) {
|
|
||||||
var $selector = selector ? $(selector) : $('.ecommerce-line-chart-s3');
|
|
||||||
$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({
|
|
||||||
label: _get_data.datasets[i].label,
|
|
||||||
tension: _get_data.lineTension,
|
|
||||||
backgroundColor: _get_data.datasets[i].background,
|
|
||||||
borderWidth: 2,
|
|
||||||
borderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderColor: 'transparent',
|
|
||||||
pointBackgroundColor: 'transparent',
|
|
||||||
pointHoverBackgroundColor: "#fff",
|
|
||||||
pointHoverBorderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderWidth: 2,
|
|
||||||
pointHoverRadius: 4,
|
|
||||||
pointHoverBorderWidth: 2,
|
|
||||||
pointRadius: 4,
|
|
||||||
pointHitRadius: 4,
|
|
||||||
data: _get_data.datasets[i].data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var chart = new Chart(selectCanvas, {
|
|
||||||
type: 'line',
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
tooltips: {
|
|
||||||
enabled: true,
|
|
||||||
rtl: NioApp.State.isRTL,
|
|
||||||
callbacks: {
|
|
||||||
title: function title(tooltipItem, data) {
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
label: function label(tooltipItem, data) {
|
|
||||||
return data.datasets[tooltipItem.datasetIndex]['data'][tooltipItem['index']] + ' ' + _get_data.dataUnit;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
backgroundColor: '#1c2b46',
|
|
||||||
titleFontSize: 8,
|
|
||||||
titleFontColor: '#fff',
|
|
||||||
titleMarginBottom: 4,
|
|
||||||
bodyFontColor: '#fff',
|
|
||||||
bodyFontSize: 8,
|
|
||||||
bodySpacing: 4,
|
|
||||||
yPadding: 6,
|
|
||||||
xPadding: 6,
|
|
||||||
footerMarginTop: 0,
|
|
||||||
displayColors: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: false,
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
padding: 0
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: NioApp.hexRGB("#526484", .2),
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
source: 'auto',
|
|
||||||
padding: 0,
|
|
||||||
reverse: NioApp.State.isRTL
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: "transparent",
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2),
|
|
||||||
offsetGridLines: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} // init chart
|
|
||||||
|
|
||||||
|
|
||||||
NioApp.coms.docReady.push(function () {
|
|
||||||
ecommerceLineS3();
|
|
||||||
});
|
|
||||||
var salesStatistics = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'People',
|
|
||||||
lineTension: .4,
|
|
||||||
datasets: [{
|
|
||||||
label: "Total orders",
|
|
||||||
color: "#9d72ff",
|
|
||||||
dash: 0,
|
|
||||||
background: NioApp.hexRGB('#9d72ff', .15),
|
|
||||||
data: [3710, 4820, 4810, 5480, 5300, 5670, 6660, 4830, 5590, 5730, 4790, 4950, 5100, 5800, 5950, 5850, 5950, 4450, 4900, 8000, 7200, 7250, 7900, 8950, 6300, 7200, 7250, 7650, 6950, 4750]
|
|
||||||
}, {
|
|
||||||
label: "Canceled orders",
|
|
||||||
color: "#eb6459",
|
|
||||||
dash: [5],
|
|
||||||
background: "transparent",
|
|
||||||
data: [110, 220, 810, 480, 600, 670, 660, 830, 590, 730, 790, 950, 100, 800, 950, 850, 950, 450, 900, 0, 200, 250, 900, 950, 300, 200, 250, 650, 950, 750]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ecommerceLineS4(selector, set_data) {
|
|
||||||
var $selector = selector ? $(selector) : $('.ecommerce-line-chart-s4');
|
|
||||||
$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({
|
|
||||||
label: _get_data.datasets[i].label,
|
|
||||||
tension: _get_data.lineTension,
|
|
||||||
backgroundColor: _get_data.datasets[i].background,
|
|
||||||
borderWidth: 2,
|
|
||||||
borderDash: _get_data.datasets[i].dash,
|
|
||||||
borderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderColor: 'transparent',
|
|
||||||
pointBackgroundColor: 'transparent',
|
|
||||||
pointHoverBackgroundColor: "#fff",
|
|
||||||
pointHoverBorderColor: _get_data.datasets[i].color,
|
|
||||||
pointBorderWidth: 2,
|
|
||||||
pointHoverRadius: 4,
|
|
||||||
pointHoverBorderWidth: 2,
|
|
||||||
pointRadius: 4,
|
|
||||||
pointHitRadius: 4,
|
|
||||||
data: _get_data.datasets[i].data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var chart = new Chart(selectCanvas, {
|
|
||||||
type: 'line',
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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']];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
backgroundColor: '#1c2b46',
|
|
||||||
titleFontSize: 13,
|
|
||||||
titleFontColor: '#fff',
|
|
||||||
titleMarginBottom: 6,
|
|
||||||
bodyFontColor: '#fff',
|
|
||||||
bodyFontSize: 12,
|
|
||||||
bodySpacing: 4,
|
|
||||||
yPadding: 10,
|
|
||||||
xPadding: 10,
|
|
||||||
footerMarginTop: 0,
|
|
||||||
displayColors: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
display: true,
|
|
||||||
stacked: _get_data.stacked ? _get_data.stacked : false,
|
|
||||||
position: NioApp.State.isRTL ? "right" : "left",
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: true,
|
|
||||||
fontSize: 11,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
padding: 10,
|
|
||||||
callback: function callback(value, index, values) {
|
|
||||||
return '$ ' + value;
|
|
||||||
},
|
|
||||||
min: 0,
|
|
||||||
stepSize: 3000
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: NioApp.hexRGB("#526484", .2),
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
stacked: _get_data.stacked ? _get_data.stacked : false,
|
|
||||||
ticks: {
|
|
||||||
fontSize: 9,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
source: 'auto',
|
|
||||||
padding: 10,
|
|
||||||
reverse: NioApp.State.isRTL
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: "transparent",
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: 'transparent'
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} // init chart
|
|
||||||
|
|
||||||
|
|
||||||
NioApp.coms.docReady.push(function () {
|
|
||||||
ecommerceLineS4();
|
|
||||||
});
|
|
||||||
var averargeOrder = {
|
|
||||||
labels: ["01 Jan", "02 Jan", "03 Jan", "04 Jan", "05 Jan", "06 Jan", "07 Jan", "08 Jan", "09 Jan", "10 Jan", "11 Jan", "12 Jan", "13 Jan", "14 Jan", "15 Jan", "16 Jan", "17 Jan", "18 Jan", "19 Jan", "20 Jan", "21 Jan", "22 Jan", "23 Jan", "24 Jan", "25 Jan", "26 Jan", "27 Jan", "28 Jan", "29 Jan", "30 Jan"],
|
|
||||||
dataUnit: 'People',
|
|
||||||
lineTension: .1,
|
|
||||||
datasets: [{
|
|
||||||
label: "Active Users",
|
|
||||||
color: "#b695ff",
|
|
||||||
background: "#b695ff",
|
|
||||||
data: [1110, 1220, 1310, 980, 900, 770, 1060, 830, 690, 730, 790, 950, 1100, 800, 1250, 850, 950, 450, 900, 1000, 1200, 1250, 900, 950, 1300, 1200, 1250, 650, 950, 750]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ecommerceBarS1(selector, set_data) {
|
|
||||||
var $selector = selector ? $(selector) : $('.ecommerce-bar-chart-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({
|
|
||||||
label: _get_data.datasets[i].label,
|
|
||||||
tension: _get_data.lineTension,
|
|
||||||
backgroundColor: _get_data.datasets[i].background,
|
|
||||||
borderWidth: 2,
|
|
||||||
borderColor: _get_data.datasets[i].color,
|
|
||||||
data: _get_data.datasets[i].data,
|
|
||||||
barPercentage: .7,
|
|
||||||
categoryPercentage: .7
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var chart = new Chart(selectCanvas, {
|
|
||||||
type: 'bar',
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
tooltips: {
|
|
||||||
enabled: true,
|
|
||||||
rtl: NioApp.State.isRTL,
|
|
||||||
callbacks: {
|
|
||||||
title: function title(tooltipItem, data) {
|
|
||||||
return false; //data['labels'][tooltipItem[0]['index']];
|
|
||||||
},
|
|
||||||
label: function label(tooltipItem, data) {
|
|
||||||
return data.datasets[tooltipItem.datasetIndex]['data'][tooltipItem['index']];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
backgroundColor: '#1c2b46',
|
|
||||||
titleFontSize: 9,
|
|
||||||
titleFontColor: '#fff',
|
|
||||||
titleMarginBottom: 6,
|
|
||||||
bodyFontColor: '#fff',
|
|
||||||
bodyFontSize: 9,
|
|
||||||
bodySpacing: 4,
|
|
||||||
yPadding: 6,
|
|
||||||
xPadding: 6,
|
|
||||||
footerMarginTop: 0,
|
|
||||||
displayColors: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
display: true,
|
|
||||||
position: NioApp.State.isRTL ? "right" : "left",
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: false,
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
padding: 0,
|
|
||||||
display: false,
|
|
||||||
stepSize: 100
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: NioApp.hexRGB("#526484", .2),
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: NioApp.hexRGB("#526484", .2)
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontColor: '#9eaecf',
|
|
||||||
source: 'auto',
|
|
||||||
padding: 0,
|
|
||||||
reverse: NioApp.State.isRTL
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
color: "transparent",
|
|
||||||
tickMarkLength: 0,
|
|
||||||
zeroLineColor: 'transparent',
|
|
||||||
offsetGridLines: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} // init chart
|
|
||||||
|
|
||||||
|
|
||||||
NioApp.coms.docReady.push(function () {
|
|
||||||
ecommerceBarS1();
|
|
||||||
});
|
|
||||||
var trafficSources = {
|
|
||||||
labels: ["Organic Search", "Social Media", "Referrals", "Others"],
|
|
||||||
dataUnit: 'People',
|
|
||||||
legend: false,
|
|
||||||
datasets: [{
|
|
||||||
borderColor: "#fff",
|
|
||||||
background: ["#b695ff", "#b8acff", "#ffa9ce", "#f9db7b"],
|
|
||||||
data: [4305, 859, 482, 138]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
@if(is_role(['1']))
|
@if(is_role(['1']))
|
||||||
var issueStatistics = {
|
var issueStatistics = {
|
||||||
labels: ["Krisis", "Negatif", "Netral", "Positif"],
|
labels: ["Krisis", "Negatif", "Netral", "Positif"],
|
||||||
|
|||||||
@ -91,6 +91,7 @@
|
|||||||
@if (isset($overview_page))
|
@if (isset($overview_page))
|
||||||
<script src="{{asset('assets/dashboard/js/libs/fullcalendar.js?ver=3.0.3')}}"></script>
|
<script src="{{asset('assets/dashboard/js/libs/fullcalendar.js?ver=3.0.3')}}"></script>
|
||||||
@include('partials.app.overview-statistics')
|
@include('partials.app.overview-statistics')
|
||||||
|
@include('dashboard.media-monitorings.statistics.media-monitoring-statistics')
|
||||||
|
|
||||||
@if(is_role(['1']))
|
@if(is_role(['1']))
|
||||||
@include('partials.app.calendars.admin')
|
@include('partials.app.calendars.admin')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user