|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/liminfinity.edukrypt.in/public/admin/js/examples/ |
Upload File : |
'use strict';
$(document).ready(function () {
var chartColors = {
primary: {
base: '#3f51b5',
light: '#c0c5e4'
},
danger: {
base: '#f2125e',
light: '#fcd0df'
},
success: {
base: '#0acf97',
light: '#cef5ea'
},
warning: {
base: '#ff8300',
light: '#ffe6cc'
},
info: {
base: '#00bcd4',
light: '#e1efff'
},
dark: '#37474f',
facebook: '#3b5998',
twitter: '#55acee',
linkedin: '#0077b5',
instagram: '#517fa4',
whatsapp: '#25D366',
dribbble: '#ea4c89',
google: '#DB4437',
borderColor: '#e8e8e8',
fontColor: '#999'
};
if ($('body').hasClass('dark')) {
chartColors.borderColor = 'rgba(255, 255, 255, .1)';
chartColors.fontColor = 'rgba(255, 255, 255, .4)';
}
function sparkline_mode1() {
if ($(".sparkline-demo1").length) {
$(".sparkline-demo1").sparkline([5, 6, 7, 2, 2, 6, 2, 4, 7, 9, 3, 5], {
type: 'bar',
height: '40',
barWidth: 5,
barSpacing: 3,
barColor: chartColors.primary.base
});
}
}
function sparkline_mode2() {
if ($(".sparkline-demo2").length) {
$(".sparkline-demo2").sparkline([5, 6, 7, 2, 2, 6, 2, 4, 7, 9, 3, 5], {
type: 'bar',
height: '40',
barWidth: 5,
barSpacing: 3,
barColor: chartColors.success.base
});
}
}
function sparkline_mode3() {
if ($(".sparkline-demo3").length) {
$(".sparkline-demo3").sparkline([5, 6, 7, 2, 2, 6, 2, 4, 7, 9, 3, 5], {
type: 'bar',
height: '40',
barWidth: 5,
barSpacing: 3,
barColor: chartColors.danger.base
});
}
}
function sparkline_mode4() {
if ($(".sparkline-demo4").length) {
$(".sparkline-demo4").sparkline([5, 6, 7, 2, 2, 6, 2, 4, 7, 9, 3, 5], {
type: 'bar',
height: '40',
barWidth: 5,
barSpacing: 3,
barColor: chartColors.warning.base
});
}
}
function chart_func_run() {
sparkline_mode1();
sparkline_mode2();
sparkline_mode3();
sparkline_mode4();
}
$(window).on('resize', chart_func_run());
chart_demo_1();
chart_demo_2();
chart_demo_3();
chart_demo_4();
chart_demo_5();
chart_demo_6();
chart_demo_7();
chart_demo_8();
chart_demo_9();
chart_demo_10();
function chart_demo_1() {
if ($('#chart_demo_1').length) {
var element = document.getElementById("chart_demo_1");
element.height = 146;
new Chart(element, {
type: 'bar',
data: {
labels: ["2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019"],
datasets: [
{
label: "Total Sales",
backgroundColor: chartColors.primary.base,
data: [133, 221, 783, 978, 214, 421, 211, 577]
}, {
label: "Average",
backgroundColor: chartColors.primary.light,
data: [408, 947, 675, 734, 325, 672, 632, 213]
}
]
},
options: {
legend: {
display: false
},
scales: {
xAxes: [{
ticks: {
fontSize: 11,
fontColor: chartColors.fontColor
},
gridLines: {
display: false
}
}],
yAxes: [{
ticks: {
fontSize: 11,
fontColor: chartColors.fontColor
}
}],
}
}
})
}
}
function chart_demo_2() {
if ($('#chart_demo_2').length) {
var ctx = document.getElementById('chart_demo_2').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels: ["Jun 2016", "Jul 2016", "Aug 2016", "Sep 2016", "Oct 2016", "Nov 2016", "Dec 2016", "Jan 2017", "Feb 2017", "Mar 2017", "Apr 2017", "May 2017"],
datasets: [{
label: "Rainfall",
backgroundColor: chartColors.primary.light,
borderColor: chartColors.primary.base,
data: [26.4, 39.8, 66.8, 66.4, 40.6, 55.2, 77.4, 69.8, 57.8, 76, 110.8, 142.6],
}]
},
options: {
legend: {
display: false,
labels: {
fontColor: chartColors.fontColor
}
},
title: {
display: true,
text: 'Precipitation in Toronto',
fontColor: chartColors.fontColor,
},
scales: {
yAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Precipitation in mm',
fontColor: chartColors.fontColor,
}
}],
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
beginAtZero: true
}
}]
}
}
});
}
}
function chart_demo_3() {
if ($('#chart_demo_3').length) {
var element = document.getElementById("chart_demo_3"),
ctx = element.getContext("2d");
element.height = 126;
new Chart(ctx, {
type: 'line',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [{
label: 'Success',
borderColor: chartColors.success.base,
data: [-10, 30, -20, 0, 25, 44, 30, 15, 20, 10, 5, -5],
pointRadius: 5,
pointHoverRadius: 7,
borderDash: [2, 2],
fill: false
}, {
label: 'Return',
fill: false,
borderDash: [2, 2],
borderColor: chartColors.danger.base,
data: [20, 0, 22, 39, -10, 19, -7, 0, 15, 0, -10, 5],
pointRadius: 5,
pointHoverRadius: 7
}]
},
options: {
responsive: true,
legend: {
display: false,
labels: {
fontColor: chartColors.fontColor
}
},
title: {
display: false,
fontColor: chartColors.fontColor
},
scales: {
xAxes: [{
gridLines: {
display: false,
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
display: false
}
}],
yAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
min: -50,
max: 50
}
}],
}
}
});
}
}
function chart_demo_4() {
if ($('#chart_demo_4').length) {
var ctx = document.getElementById("chart_demo_4").getContext("2d");
var densityData = {
backgroundColor: chartColors.primary.light,
data: [10, 20, 40, 60, 80, 40, 60, 80, 40, 80, 20, 59]
};
new Chart(ctx, {
type: 'bar',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [densityData]
},
options: {
scaleFontColor: "#FFFFFF",
legend: {
display: false,
labels: {
fontColor: chartColors.fontColor
}
},
scales: {
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}],
yAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
min: 0,
max: 100,
beginAtZero: true
}
}]
}
}
});
}
}
function chart_demo_5() {
if ($('#chart_demo_5').length) {
var ctx = document.getElementById('chart_demo_5').getContext('2d');
window.myBar = new Chart(ctx, {
type: 'bar',
data: {
labels: ['January', 'February', 'March', 'April', 'May'],
datasets: [
{
label: 'Dataset 1',
backgroundColor: [
chartColors.info.base,
chartColors.success.base,
chartColors.danger.base,
chartColors.dark,
chartColors.warning.base,
],
yAxisID: 'y-axis-1',
data: [33, 56, -40, 25, 45]
},
{
label: 'Dataset 2',
backgroundColor: chartColors.info.base,
yAxisID: 'y-axis-2',
data: [23, 86, -40, 5, 45]
}
]
},
options: {
legend: {
labels: {
fontColor: chartColors.fontColor
}
},
responsive: true,
title: {
display: true,
text: 'Chart.js Bar Chart - Multi Axis',
fontColor: chartColors.fontColor
},
tooltips: {
mode: 'index',
intersect: true
},
scales: {
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}],
yAxes: [
{
type: 'linear',
display: true,
position: 'left',
id: 'y-axis-1',
},
{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
},
{
type: 'linear',
display: true,
position: 'right',
id: 'y-axis-2',
gridLines: {
drawOnChartArea: false
},
ticks: {
fontColor: chartColors.fontColor
}
}
],
}
}
});
}
}
function chart_demo_6() {
if ($('#chart_demo_6').length) {
var ctx = document.getElementById("chart_demo_6").getContext("2d");
var speedData = {
labels: ["0s", "10s", "20s", "30s", "40s", "50s", "60s"],
datasets: [{
label: "Car Speed (mph)",
borderColor: chartColors.primary.base,
backgroundColor: 'rgba(0, 0, 0, 0',
data: [0, 59, 75, 20, 20, 55, 40]
}]
};
var chartOptions = {
legend: {
scaleFontColor: "#FFFFFF",
position: 'top',
labels: {
fontColor: chartColors.fontColor
}
},
scales: {
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}],
yAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}]
}
};
new Chart(ctx, {
type: 'line',
data: speedData,
options: chartOptions
});
}
}
function chart_demo_7() {
if ($('#chart_demo_7').length) {
var ctx = document.getElementById("chart_demo_7").getContext("2d");
new Chart(ctx, {
type: 'doughnut',
data: {
datasets: [{
data: [15, 25, 10, 30],
backgroundColor: [
chartColors.success.light,
chartColors.danger.light,
chartColors.warning.light,
chartColors.info.light
],
label: 'Dataset 1'
}],
labels: [
'Social Media',
'Organic Search',
'Referrral',
'Email'
]
},
options: {
elements: {
arc: {
borderWidth: 0
}
},
responsive: true,
legend: {
display: false
},
title: {
display: false
},
animation: {
animateScale: true,
animateRotate: true
}
}
});
}
}
function chart_demo_8() {
if ($('#chart_demo_8').length) {
new Chart(document.getElementById("chart_demo_8"), {
type: 'radar',
data: {
labels: ["Africa", "Asia", "Europe", "Latin America", "North America"],
datasets: [
{
label: "1950",
fill: true,
backgroundColor: "rgba(179,181,198,0.2)",
borderColor: "rgba(179,181,198,1)",
pointBorderColor: "#fff",
pointBackgroundColor: "rgba(179,181,198,1)",
data: [-8.77, -55.61, 21.69, 6.62, 6.82]
}, {
label: "2050",
fill: true,
backgroundColor: "rgba(255,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
pointBorderColor: "#fff",
pointBackgroundColor: "rgba(255,99,132,1)",
data: [-25.48, 54.16, 7.61, 8.06, 4.45]
}
]
},
options: {
legend: {
labels: {
fontColor: chartColors.fontColor
}
},
scale: {
gridLines: {
color: chartColors.borderColor
}
},
title: {
display: true,
text: 'Distribution in % of world population',
fontColor: chartColors.fontColor
}
}
});
}
}
function chart_demo_9() {
if ($('#chart_demo_9').length) {
new Chart(document.getElementById("chart_demo_9"), {
type: 'horizontalBar',
data: {
labels: ["Africa", "Asia", "Europe", "Latin America", "North America"],
datasets: [
{
label: "Population (millions)",
backgroundColor: chartColors.primary.light,
data: [2478, 2267, 734, 1284, 1933]
}
]
},
options: {
legend: {
display: false
},
scales: {
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor,
display: false
}
}],
yAxes: [{
gridLines: {
color: chartColors.borderColor,
display: false
},
ticks: {
fontColor: chartColors.fontColor
},
barPercentage: 0.5
}]
}
}
});
}
}
function chart_demo_10() {
if ($('#chart_demo_10').length) {
var element = document.getElementById("chart_demo_10");
new Chart(element, {
type: 'bar',
data: {
labels: ["1900", "1950", "1999", "2050"],
datasets: [
{
label: "Europe",
type: "line",
borderColor: "#8e5ea2",
data: [408, 547, 675, 734],
fill: false
},
{
label: "Africa",
type: "line",
borderColor: "#3e95cd",
data: [133, 221, 783, 2478],
fill: false
},
{
label: "Europe",
type: "bar",
backgroundColor: chartColors.primary.base,
data: [408, 547, 675, 734],
},
{
label: "Africa",
type: "bar",
backgroundColor: chartColors.primary.light,
data: [133, 221, 783, 2478]
}
]
},
options: {
title: {
display: true,
text: 'Population growth (millions): Europe & Africa',
fontColor: chartColors.fontColor
},
legend: {
display: true,
labels: {
fontColor: chartColors.fontColor
}
},
scales: {
xAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}],
yAxes: [{
gridLines: {
color: chartColors.borderColor
},
ticks: {
fontColor: chartColors.fontColor
}
}]
}
}
});
}
}
function comments_chart_demo() {
if ($('#comments_chart_demo').length) {
var ctx = document.getElementById("comments_chart_demo").getContext("2d");
var speedData = {
labels: ["0s", "10s", "20s", "30s", "40s", "50s", "60s"],
datasets: [{
label: "Car Speed (mph)",
borderColor: 'white',
backgroundColor: 'rgba(0, 0, 0, 0',
data: [0, 59, 75, 20, 20, 55, 40]
}]
};
var chartOptions = {
legend: {
scaleFontColor: "#FFFFFF",
display: false,
position: 'top',
labels: {
boxWidth: 80,
fontColor: 'black'
}
},
scales: {
xAxes: [{
gridLines: {
color: 'rgba(255, 255, 255, .2)'
},
ticks: {
fontColor: 'rgba(255, 255, 255, .7)'
}
}],
yAxes: [{
gridLines: {
color: 'rgba(255, 255, 255, .2)'
},
ticks: {
fontColor: 'rgba(255, 255, 255, .7)'
}
}]
}
};
new Chart(ctx, {
type: 'line',
data: speedData,
options: chartOptions
});
}
}
comments_chart_demo();
if ($('#circle-1').length) {
$('#circle-1').circleProgress({
startAngle: 1.55,
value: 0.65,
size: 110,
thickness: 10,
fill: {
color: chartColors.primary.base
}
});
}
if ($('#circle-2').length) {
$('#circle-2').circleProgress({
startAngle: 1.55,
value: 0.35,
size: 110,
thickness: 10,
fill: {
color: chartColors.info.base
}
});
}
////////////////////////////////////////////
function bar_chart() {
if ($('#chart-ticket-status').length > 0) {
var dataSource = [
{country: "USA", hydro: 59.8, oil: 937.6, gas: 582, coal: 564.3, nuclear: 187.9},
{country: "China", hydro: 74.2, oil: 308.6, gas: 35.1, coal: 956.9, nuclear: 11.3},
{country: "Russia", hydro: 40, oil: 128.5, gas: 361.8, coal: 105, nuclear: 32.4},
{country: "Japan", hydro: 22.6, oil: 241.5, gas: 64.9, coal: 120.8, nuclear: 64.8},
{country: "India", hydro: 19, oil: 119.3, gas: 28.9, coal: 204.8, nuclear: 3.8},
{country: "Germany", hydro: 6.1, oil: 123.6, gas: 77.3, coal: 85.7, nuclear: 37.8}
];
// Return with commas in between
var numberWithCommas = function (x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
var dataPack1 = [40, 47, 44, 38, 27, 40, 47, 44, 38, 27, 40, 27];
var dataPack2 = [10, 12, 7, 5, 4, 10, 12, 7, 5, 4, 10, 12];
var dataPack3 = [17, 11, 22, 18, 12, 17, 11, 22, 18, 12, 17, 11];
var dates = ["Jan", "Jan", "Jan", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"];
var bar_ctx = document.getElementById('chart-ticket-status');
bar_ctx.height = 115;
new Chart(bar_ctx, {
type: 'bar',
data: {
labels: dates,
datasets: [
{
label: 'Pending Tickets',
data: dataPack1,
backgroundColor: chartColors.primary.light,
hoverBorderWidth: 0
},
{
label: 'Solved Tickets',
data: dataPack2,
backgroundColor: chartColors.success.light,
hoverBorderWidth: 0
},
{
label: 'Open Tickets',
data: dataPack3,
backgroundColor: chartColors.danger.light,
hoverBorderWidth: 0
},
]
},
options: {
legend: {
display: false
},
animation: {
duration: 10,
},
tooltips: {
mode: 'label',
callbacks: {
label: function (tooltipItem, data) {
return data.datasets[tooltipItem.datasetIndex].label + ": " + numberWithCommas(tooltipItem.yLabel);
}
}
},
scales: {
xAxes: [{
stacked: true,
gridLines: {display: false},
ticks: {
fontSize: 11,
fontColor: chartColors.fontColor
}
}],
yAxes: [{
stacked: true,
ticks: {
callback: function (value) {
return numberWithCommas(value);
},
fontSize: 11,
fontColor: chartColors.fontColor
},
}],
}
},
plugins: [{
beforeInit: function (chart) {
chart.data.labels.forEach(function (value, index, array) {
var a = [];
a.push(value.slice(0, 5));
var i = 1;
while (value.length > (i * 5)) {
a.push(value.slice(i * 5, (i + 1) * 5));
i++;
}
array[index] = a;
})
}
}]
}
);
}
}
bar_chart();
function users_chart() {
if ($('#users-chart').length > 0) {
var element = document.getElementById("users-chart");
element.height = 110;
new Chart(element, {
type: 'bar',
data: {
labels: ["Jan", "Fen", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"],
datasets: [{
label: "Europe",
type: "bar",
backgroundColor: chartColors.info.base,
data: [408, 547, 675, 734, 122, 323, 94, 312, 282, 500, 800, 1050],
}, {
label: "Africa",
type: "bar",
backgroundColor: chartColors.success.base,
data: [133, 221, 783, 1478, 821, 321, 400, 200, 820, 300, 511, 100]
}]
},
options: {
title: {
display: false
},
legend: {display: false},
scales: {
yAxes: [{
fontSize: 11,
fontColor: chartColors.fontColor
}],
xAxes: [{
gridLines: {display: false},
ticks: {
display: false
}
}]
}
}
});
}
}
users_chart();
function device_session_chart() {
if ($('#device_session_chart').length > 0) {
var element = document.getElementById("device_session_chart");
element.height = 155;
new Chart(element, {
type: 'line',
data: {
labels: [1500, 1600, 1700, 1750, 1800, 1850, 1900, 1950, 1999, 2050],
datasets: [{
data: [2186, 2000, 1900, 2300, 2150, 2100, 2350, 2500, 2400, 2390],
label: "Mobile",
borderColor: chartColors.primary.base,
fill: false
}, {
data: [1282, 1000, 1290, 1302, 1400, 1250, 1350, 1402, 1700, 1967],
label: "Desktop",
borderColor: chartColors.success.base,
fill: false
}, {
data: [500, 700, 900, 800, 600, 850, 900, 550, 750, 690],
label: "Other",
borderColor: chartColors.warning.base,
fill: false
}]
},
options: {
title: {
display: false
},
legend: {display: false},
scales: {
yAxes: [{
gridLines: {display: false},
ticks: {
display: false
}
}],
xAxes: [{
gridLines: {display: false},
ticks: {
fontSize: 11,
fontColor: chartColors.fontColor
}
}],
}
}
});
}
}
device_session_chart();
});