File: /home/cafsindia/hrms_allyindian_com/dist/highcharts/dashboard_cadd.js
$(document).ready(function() {
Highcharts.theme = {
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572',
'#FF9655', '#FFF263', '#6AF9C4'],
chart: {
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(240, 240, 255)']
]
},
},
title: {
style: {
color: '#000',
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
}
},
subtitle: {
style: {
color: '#666666',
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
}
},
credits:{
enabled: false
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
x: -40,
y: 80,
floating: true,
borderWidth: 1,
backgroundColor:
Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
shadow: true,
itemStyle: {fontSize: '10px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
},
plotOptions: {
pie:{
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
showInLegend: true
},
line: {
pointWidth: 70,
pointPadding: 0.2,
borderWidth: 0,
dataLabels: {
style:{fontSize: '12px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
align: 'left',
enabled: true,
}
},
},
};
Highcharts.setOptions({
lang: {
noData: 'No Data Available' ,
}
});
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
});
// BRAND WISE NETPAY
function brand_salary_info(encData){
var options = {
chart: {
type: 'pie',
plotLeft: -10,
renderTo: 'dept_salary_info',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Brand wise Net Pay'
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> '+ this.point.name +'<b>: '+ this.y+'</b>';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
color: '#000000',
style: {fontSize: '8pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
connectorColor: '#000000',
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> ';
//return '<b>' + this.point.name + '</b>: ' + this.y;
}
// formatter: function() {
// return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> '+ this.point.name +'<b>: '+ this.y+'</b>';
// }
},
}
},
legend: {verticalAlign: 'top',itemStyle: {fontSize: '8px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},x:8},
series: []
};
$.ajax({
type: "POST",
data: encData,
url: './index.php/home/brand_netpay_info',
beforeSend: function() {
$("#dept_salary_info").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#dept_salary_info').attr('disabled','disabled');
},
success: function(data) {
$("#dept_salary_info").attr('disabled',false);
var rslt = JSON.parse(data);
options.series = rslt.series;
//options.drilldown.series = rslt.drill_list;
chart = new Highcharts.Chart(options);
},
});
}
// BRAND WISE EMPLOYEE COUNT
function get_brandwise_employee_count_info(encData){
var brand_wise_employee = {
chart: {
type: 'bar',
renderTo: 'brand_wise_employee'
},
title: {
text: 'Brand Wise Employees Count',
x: -20 //center
},
xAxis: {
title: {
text: 'Brand'
}
},
yAxis: {
plotLines: [{
value: 0,
width: 1,
color: '#0001'
}]
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'}
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: []
};
$.ajax({
type: "POST",
data: encData,
url: './index.php/home/get_brandwise_employee_count_info',
beforeSend: function() {
$("#brand_wise_employee").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#brand_wise_employee').attr('disabled','disabled');
},
success: function(data) {
$("#brand_wise_employee").attr('disabled',false);
var rslt = JSON.parse(data);
brand_wise_employee.xAxis.categories = rslt[0]['data'];
brand_wise_employee.series[0] = rslt[1];
chart = new Highcharts.Chart(brand_wise_employee);
},
});
}
// LOCATION WISE EMPLOYEE COUNT
function employees_count_chart(start_date,end_date)
{
var options = {
chart: {
renderTo: 'employees_count_chart',
type: 'line'
},
title: {
text: 'Location Wise Employees Count',
x: -20 //center
},
subtitle: {
text: 'Total Employees',
x: -20
},
xAxis: {
categories: [],
title: {
text: 'Department'
}
},
yAxis: {
title: {
text: 'Count'
},
plotLines: [{
value: 0,
width: 1,
color: '#d84f57'
}]
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
borderWidth: 0
},
series: []
};
$("#employees_count_chart").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#employees_count_chart').attr('disabled','disabled');
$.getJSON("./index.php/Home/employees_count_chart?start_date="+start_date+"&end_date="+end_date, function(json) {
//alert(data);
$('#employees_count_chart').attr('disabled', false);
options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
options.series[0] = json[1];
chart = new Highcharts.Chart(options);
});
}
// GENDER WISE COUNT AND PERCENTAGE
function gen_distribution_chart(encData){
var options = {
chart: {
type: 'pie',
name:'Gender Distribution',
renderTo: 'gen_distribution_chart',
plotBorderWidth: null,
plotShadow: false,
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Gender Wise count'
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> '+ this.point.name +'<b>: '+ this.y+'</b>';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
color: '#000000',
style: {fontSize: '8pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
connectorColor: '#000000',
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> '+ this.point.name +'<b>: '+ this.y+'</b>';
}
},
}
},
legend: {verticalAlign: 'top',itemStyle: {fontSize: '8px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},},
series: [],
drilldown: {
series: []
}
};
$.ajax({
type: "POST",
data: encData,
url: './index.php/home/gen_distribution_chart_cadd',
beforeSend: function() {
$("#gen_distribution_chart").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#gen_distribution_chart').attr('disabled','disabled');
},
success: function(data) {
$('#gen_distribution_chart').attr('disabled',false);
var rslt = JSON.parse(data);
options.series = rslt.series;
options.drilldown.series = rslt.drill_list;
chart = new Highcharts.Chart(options);
},
});
}
//LOCATION WISE NET PAY
function get_netpay_loc_chart(encData){
var options = {
chart: {
type: 'pie',
renderTo: 'get_netpay_loc_chart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Location Wise Net Pay'
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> '+ this.point.name +'<b>: '+ this.y+'</b>';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
color: '#000000',
style: {fontSize: '8pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
connectorColor: '#000000',
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.point.percentage)+' %</b> ';
//return '<b>' + this.point.name + '</b>: ' + this.y;
}
},
}
},
legend: {verticalAlign: 'top',itemStyle: {fontSize: '8px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},},
series: []
};
$.ajax({
type: "POST",
data: encData,
url: './index.php/home/get_netpay_loc_chart',
beforeSend: function() {
$("#get_netpay_loc_chart").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#get_netpay_loc_chart').attr('disabled','disabled');
},
success: function(data) {
$('#get_netpay_loc_chart').attr('disabled',false);
var rslt = JSON.parse(data);
options.series = rslt.series;
//options.drilldown.series = rslt.drill_list;
chart = new Highcharts.Chart(options);
},
});
}
//AGE WISE EMPLOYEE COUNT
function age_wise_emp_count(encData)
{
var design_wise_sal = {
chart: {
renderTo: 'age_wise_emp_count',
type: 'column'
},
title:{
text: 'Age Wise Employee Count',
x: -20 //center
},
xAxis:{
categories: [],
title: {
text: 'Age'
}
},
yAxis: {
title: {
text: 'Count'
},
plotLines: [{
value: 0,
width: 1,
color: '#d84f57'
}]
},
tooltip: {
style: {fontSize: '10pt', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
borderWidth: 0,
itemStyle: {fontSize: '10px', fontWeight: 'bold',fontFamily: '"Trebuchet MS", Verdana, sans-serif',color: '#000'},
},
series: []
};
$.ajax({
type: "POST",
data: encData,
url: './index.php/home/age_wise_emp_count',
beforeSend: function() {
$("#age_wise_emp_count").html('<span><i class=\"fa fa-spinner fa-spin fa-2x fa-fw\"></i><br/>Processing...</span>');
$('#age_wise_emp_count').attr('disabled','disabled');
},
success: function(data) {
$('#age_wise_emp_count').attr('disabled',false);
var rslt = JSON.parse(data);
design_wise_sal.xAxis.categories = rslt[0]['data'];
design_wise_sal.series[0] = rslt[1];
chart = new Highcharts.Chart(design_wise_sal);
},
});
}