var feaLayer = [] var resu; var provincesArray; var pahneArray = []; var citiesArray; var iranGeoJSON; var iranMapGeo; var iranArrayCount = 0; var iranCityCount = 0; var keepMapFeatureColor = null; var fullCityGeoJSONTemp = new Object(); var fullCityGeoJSON = null; var iranCityMapGeo; var flagProvince = 0; var flagCity = 0; var HopeData; var statusSet; var sortable = []; var sortable2 = []; var minOfPahne; var maxOfPahne; var damaneh; var charak; var charakAval; var charakDovom; var rahdariPercent; var pageUrl = window.location.href; var ajaxUrl = new URL("https://rms.rmto.ir/api/milad"); var myChartSixth var myChartJariSecond var myChart23 var indexCol = 1; //project //daily //misson // handle //danger95 // danger99 // block var dataSix = []; var forRefresh = $('#dateTo').val(); var forRefresh2 = $('#dateFrom').val() window.addEventListener('resize', function () { // //console.log( // Chart.instances ); //console.log("inaro ki yadet dad"); // Chart.instances[6].resize(); }); $(document).ready(function () { $.ajax({ url: "https://rms.rmto.ir/public/contents/provinces", type: "GET", cache: false, contentType: false, processData: false, success: function (result) { provincesArray = result.data; // feaLayer = result.data; $.ajax({ url: "https://rms.rmto.ir/api/milad?i=1", // url: "https://rms.rmto.ir/public/bama-homepage", type: "GET", cache: false, success: function (result) { //console.log("apiRes",result); resu = result; ShowBi(result); }, error: function (error) { //console.log(error); }, }); }, error: function (error) { }, }); init_province_filter(); }); //in normal way of filtering $("#select-month").prop("disabled", true); $("#dateFrom").prop("disabled", true); $("#dateTo").prop("disabled", true); //in normal way of filtering var bounds = [ [42.9130026312, 75.6166317076], [20.5782370061, 30.5092252948], ]; const MAP_ENDPOINT = "https://rmsmap.rmto.ir"; const MAP_MIN_ZOOM = 4.2; const MAP_MAX_ZOOM = 15; var map = L.map("map", { maxBounds: bounds, minZoom: MAP_MIN_ZOOM, //maxZoom: MAP_MAX_ZOOM, zoomControl: true, }).setView([32.4279, 53.6880], 5); L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map); map.zoomControl.setPosition('topright'); // var map2 = L.map("map2", { // maxBounds: bounds, // minZoom: MAP_MIN_ZOOM, // //maxZoom: MAP_MAX_ZOOM, // zoomControl: false, // }).setView([32.4279, 53.6880], 4.2); // L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map2); var chartColors = [ "#4929ac", "#202be0", "#4962ac", "#4286d3", "#000c7f", "#2aa9db", "#8690ef", "#00587a", "#88b3cb", "rgba(255, 64, 255, 1)", "rgba(159, 159, 64, 1)", "#ff5c0f", "#4962ac", ]; Chart.defaults.global.defaultFontFamily = "IRANSansFaNum"; var progressBar = document.getElementById("progressBar") var bar = new ProgressBar.SemiCircle(progressBar, { strokeWidth: 20, color: '#FFEA82', trailColor: '#FFEA82', trailWidth: 20, easing: 'easeInOut', duration: 1400, svgStyle: null, text: { value: '', alignToBottom: false }, from: { color: '#FFEA82' }, to: { color: '#ED6A5A' }, // Set default step function for all animate calls step: (state, bar) => { bar.path.setAttribute('stroke', state.color); var value = Math.round(bar.value() * 100); if (value === 0) { bar.setText(''); } else { bar.setText(value); } bar.text.style.color = state.color; } }); bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif'; bar.text.style.fontSize = '1rem'; // bar.animate(0.87); // Number from 0.0 to 1.0 // var ThirdChart = document.getElementById("myChartThird").getContext("2d"); // var myChartThird = new Chart(ThirdChart, { // type: "horizontalBar", // data: { // datasets: [ // { // data: [ // 100, // 98, // 87, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // ], // label: "hey" // }, // ], // labels: [ // "", // "", // "", // ], // }, // options: { // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }], // xAxes: [{ // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: false, // }, // }, // }); // var ForthChart = document.getElementById("myChartForth").getContext("2d"); // var myChartForth = new Chart(ForthChart, { // type: "horizontalBar", // data: { // datasets: [ // { // data: [ // 127, // 110, // 95, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // ], // label: "hey" // }, // ], // labels: [ // "", // "", // "", // ], // }, // options: { // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }], // xAxes: [{ // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: false, // }, // }, // }); // var FifthChart = document.getElementById("myChartFifth").getContext("2d"); // var myChartFifth = new Chart(FifthChart, { // type: "bar", // data: { // datasets: [ // { // data: [ // 127, // 110, // 95, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // ], // label: "hey" // }, // { // data: [ // 127, // 110, // 95, // ], // backgroundColor: [ // chartColors[3], // chartColors[4], // chartColors[5], // ], // label: "hey" // }, // { // data: [ // 127, // 110, // 95, // ], // backgroundColor: [ // chartColors[6], // chartColors[7], // chartColors[8], // ], // label: "hey" // }, // { // data: [ // 127, // 110, // 95, // ], // backgroundColor: [ // chartColors[9], // chartColors[10], // chartColors[11], // ], // label: "hey" // }, // ], // labels: [ // "", // "", // "", // ], // }, // options: { // scales: { // yAxes: [{ // stacked: true, // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }], // xAxes: [{ // stacked: true, // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: false, // }, // }, // }); // var EighthChart = document.getElementById("myChartEighth").getContext("2d"); // var myChartEighth = new Chart(EighthChart, { // type: "bar", // data: { // datasets: [ // { // data: [ // -16, // -30, 60, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // ], // label: "hey" // }, // { // data: [ // 127, // 110, // ], // backgroundColor: [ // chartColors[2], // chartColors[3], // ], // label: "hey" // }, // ], // labels: [ // "", // "", // ], // }, // options: { // scales: { // yAxes: [{ // stacked: true, // ticks: { // suggestedMin: 0, // suggestedMax: 100 // } // }], // xAxes: [{ // stacked: true, // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: false, // }, // }, // }); // var NinthChart = document.getElementById("myChartNinth").getContext("2d"); // var myChartNinth = new Chart(NinthChart, { // type: "bar", // data: { // datasets: [ // { // data: [ // -50, // -80, // ], // backgroundColor: [ // chartColors[4], // chartColors[5], // ], // label: "hey" // }, // { // data: [ // 91, // 19, // ], // backgroundColor: [ // chartColors[6], // chartColors[7], // ], // label: "hey" // }, // ], // labels: [ // "", // "", // ], // }, // options: { // scales: { // yAxes: [{ // stacked: true, // ticks: { // suggestedMin: 0, // suggestedMax: 100 // } // }], // xAxes: [{ // stacked: true, // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: false, // }, // }, // }); function init_province_filter() { $.ajax({ url: "https://rms.rmto.ir/public/contents/provinces", type: "GET", success: function (data) { list_province = data.data; for (let index = 0; index < list_province.length; index++) { $("#select-province").append( "\ \ " ); } }, }); } function init_town_filter() { let hold_idSelect = $("#select-province").val(); //console.log("damad"); $.ajax({ url: "https://rms.rmto.ir/public/contents/provinces/" + hold_idSelect, // hold_idSelect, type: "GET", success: function (data) { list_citys = data.data; //ppp // $("#select-city1").val(0).trigger("change"); $("#select-city").html(""); for (let index = 0; index < list_citys.length; index++) { $("#select-city").append( "\ \ " ); } }, }); // if ($("#select-province1").val() != 0) { // $(".btn-increase").prop("disabled", false); // } // $(".btn-increase").on("click", function () { // $("#append-input-forFilter2").removeClass("d-none"); // }); } $("#select-province").on("change", function () { if ($("#select-province").val() != "0") { init_town_filter(); selectedProvinceId = $("#select-province").val() zoomMapToFeature(feaLayer[list_province[selectedProvinceId - 1].abrar_feature]) var province_id = $("#select-province").val(); //console.log(province_id); $.ajax({ url: "https://rms.rmto.ir/api/milad?i=1&p=" + province_id, type: "GET", cache: false, success: function (result) { //console.log("apiRes",result); resu = result; // ShowBi(result); }, error: function (error) { //console.log(error); }, }); } }); frommDate = $("#dateFrom").persianDatepicker({ initialValueType: 'persian', format: "YYYY/MM/DD", maxDate: new persianDate().startOf('day'), autoClose: true, onSelect: function (unix) { frommDate.touched = true; $("#datepicktodate").prop("disabled", ""); if ( frommDate.getState().selected.unixDate >= tooDate.getState().selected.unixDate ) { tooDate.setDate(frommDate.getState().selected.unixDate); } if (tooDate && tooDate.options && tooDate.options.minDate != unix) { let cachedValue = tooDate.getState().selected.unixDate; tooDate.options = { minDate: unix }; if (tooDate.touched) { tooDate.setDate(cachedValue); } } }, }); // toDatekeshvari = $("#datepicktodateTestItems").persianDatepicker({ // format: "YYYY/MM/DD", // autoClose: true, // onSelect: function (unix) { // toDateTestItems.touched = true; // }, // }); // //console.log("2sob", persianDate().unix()); tooDate = $("#dateTo").persianDatepicker({ format: "YYYY/MM/DD", maxDate: new persianDate().startOf('day'), autoClose: true, onSelect: function (unix) { tooDate.touched = true; /*if (fromDate && fromDate.options && fromDate.options.maxDate != unix) { let cachedValue = fromDate.getState().selected.unixDate; fromDate.options = { maxDate: unix }; if (fromDate.touched) { fromDate.setDate(cachedValue); } }*/ }, }); // $.ajax({ // url: "https://192.168.1.75/rms_new/public/index.php/projects/ristat?end-date=2021-02-16&start-date=2020-11-21", // type: "GET", // cache: false, // success: function (result) { // //console.log("mosh moshi",result.data[0]); // for(var i=1 ; i<18 ; i++){ // dataSix[i-1] = result.data[0]["item_"+i] // } // var SixthChart = document.getElementById("myChartSixth").getContext("2d"); // var myChartSixth = new Chart(SixthChart, { // type: "horizontalBar", // data: { // datasets: [ // { // data: dataSix // // [ // // 711, // // 605, // // 511, // // 309, // // 220, // // 198, // // 178, // // 136, // // 135, // // 134, // // 118, // // 109, // // 97, // // 87, // // 65, // // 45, // // 55, // // ] // , // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[3], // chartColors[4], // chartColors[5], // chartColors[6], // chartColors[7], // chartColors[8], // chartColors[9], // chartColors[10], // chartColors[11], // chartColors[12], // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[4], // ], // label: "" // }, // ], // labels: [ // "مرمت رویه", // "پاکسازی", // "علائم", // "حفاظ", // "روشنایی", // "خط کشی", // "رنگ آمیزی", // "شستشو", // "ایمن سازی", // "حریم", // "پل", // "تونل و گالری", // "عملیات زمستانی", // "ماشین آلات", // "راهدارخانه", // "موارد اضطراری", // "آیتم های بازدید و بازرسی کنترل", // ], // }, // options: { // onClick: (e) => { // var sixPoint = myChartSixth.getElementAtEvent(e); // if (sixPoint[0]) { // //console.log("to ke dele",sixPoint[0]._index); // var label = myChartSixth.data.labels[sixPoint[0]._index]; // var value = myChartSixth.data.datasets[0].data[sixPoint[0]._index]; // //console.log("roye mood ane 6"); // //console.log(label); // //console.log(value); // // xAxes: [{ // // ticks: { // // display: false //this will remove only the label // // } // // }] // } // }, // scales: { // yAxes: [{ // ticks: { // display: false // // suggestedMin: 0, // // suggestedMax: 1017 // } // }], // xAxes: [{ // ticks: { // min: 0 // } // }] // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: true, // }, // }, // }); // }, // error: function (error) { // //console.log(error); // }, // }); $("#submitDate").on("click", function () { //console.log("hello"); let startDate = moment( frommDate.getState().selected.year + "/" + frommDate.getState().selected.month + "/" + frommDate.getState().selected.date, "jYYYY/jM/jD" ).format("YYYY-MM-DD"); let endDate = moment( tooDate.getState().selected.year + "/" + tooDate.getState().selected.month + "/" + tooDate.getState().selected.date, "jYYYY/jM/jD" ).format("YYYY-MM-DD"); //console.log("ijij","https://192.168.1.75/rms_new/public/index.php/projects/ristat"+ "?end-date=" + endDate + "&start-date=" + startDate); $.ajax({ url: "https://192.168.1.75/rms_new/public/index.php/projects/ristat" + "?end-date=" + endDate + "&start-date=" + startDate, type: "GET", cache: false, success: function (result) { //console.log("mathew",result); }, error: function (error) { //console.log(error); }, }); }) function sortObjectEntries(obj, n) { let sortedList = [] //Sorting by values asc sortedList = Object.entries(obj).sort((a, b) => { if (b[1] > a[1]) return 1; else if (b[1] < a[1]) return -1; //if values are same do edition checking if keys are in the right order else { if (a[0] > b[0]) return 1; else if (a[0] < b[0]) return -1; else return 0 } }) // return first n values from sortedList return sortedList.map(el => el[0]).slice(0, n) } var SixthChart = document.getElementById("myChartSixth").getContext("2d"); myChartSixth = new Chart(SixthChart, { type: "horizontalBar", data: { datasets: [ { data: [] , backgroundColor: [], label: "" }, ], labels: [], }, options: { onClick: (e) => { var sixPoint = myChartSixth.getElementAtEvent(e); if (sixPoint[0]) { //console.log("to ke dele",sixPoint[0]._index); var label = myChartSixth.data.labels[sixPoint[0]._index]; var value = myChartSixth.data.datasets[0].data[sixPoint[0]._index]; //console.log("roye mood ane 6"); //console.log(label); //console.log(value); // xAxes: [{ // ticks: { // display: false //this will remove only the label // } // }] } }, scales: { yAxes: [{ ticks: { display: true // suggestedMin: 0, // suggestedMax: 1017 } }], xAxes: [{ ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); function ShowBi(res) { var typeData = res.rahdari; var mapped = new Map(); mapped = res.pahne; pahneArray = []; sortable = []; // = pahneArray.map(function(el, i) { // return { index: i, value: el }; // }) // $.each(keshvari,function (key, value) { // pahneArray.push(value); // }) //console.log("erade" , mapped); //console.log("era" , mapped[2]); // var sortable = []; var sortableVal = []; var sortableProvince = [] for (var index in mapped) { sortable.push([index, mapped[index], provincesArray[index - 1].name_fa]); pahneArray.push(mapped[index]); } sortable.sort(function (a, b) { return b[1] - a[1]; }); for (var index in sortable) { sortableVal.push(sortable[index][1]) sortableProvince.push(sortable[index][2]) } minOfPahne = parseInt(sortable[sortable.length - 1][1]) maxOfPahne = parseInt(sortable[0][1]) damaneh = maxOfPahne - minOfPahne charak = Math.round(damaneh / 3) console.log("sortable", sortable); console.log("pahneArray", pahneArray); console.log("min", minOfPahne); console.log("max", maxOfPahne); console.log("damaneh", damaneh); console.log("charak", charak); charakAval = minOfPahne + charak; charakDovom = maxOfPahne - charak; console.log("charakAval", charakAval); console.log("charakDovom", charakDovom); var sortableColor = [] var color; for (var index in sortable) { // //console.log("winakan" ,sortable[index][1]); color = null; if (sortable[index][1] <= charakAval) { color = "#ff704d" sortableColor.push("#ff704d") } else if (sortable[index][1] < charakDovom) { color = "#ffeda0"; sortableColor.push("#ffeda0") } else { color = "#66cc66"; sortableColor.push("#66cc66") } sortable[index]["clr"] = color } var new_pahne = sortable.sort(function (a, b) { return a[0] - b[0]; }); $('.counter').each(function () { //console.log("logi", $(this)[0].id ); var countTo; if ($(this)[0].id == "counter1") { countTo = res.counts.rahdari; } else if ($(this)[0].id == "counter2") { countTo = res.counts.items; } else if ($(this)[0].id == "counter3") { countTo = res.counts.patrols; } else if ($(this)[0].id == "counter4") { countTo = res.counts.observds.ok; } else { countTo = 2222; } // if($(this)[0].id == "counter1"){ // var countTo = typeData.count_all; // }else{ // var countTo = 2222; // } var $this = $(this); $({ countNum: $this.text() }).animate({ countNum: countTo }, { duration: 3000, easing: 'linear', step: function () { $this.text(Math.floor(this.countNum)); }, complete: function () { $this.text(this.countNum); } }); }); var jariChartSecond = document.getElementById("myChartJariSecond").getContext("2d"); myChartJariSecond = new Chart(jariChartSecond, { type: "bar", data: { datasets: [ { data: [ ], backgroundColor: [ ], } ], labels: [ ], }, options: { onClick: (e) => { var secondPoint = myChartSecond.getElementAtEvent(e); if (secondPoint[0]) { var label = myChartSecond.data.labels[secondPoint[0]._index]; var value = myChartSecond.data.datasets[0].data[secondPoint[0]._index]; //console.log("roye mood ane 2"); //console.log(label); //console.log(value); } }, scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { display: false //this will remove only the label } }] }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#ff9999", // }, // }, responsive: true, // legend: { // display: true, // position: "right", // rtl: true, // labels: { // boxWidth: 13 // } // }, legend: { display: false, position: "left", labels: { boxWidth: 13 } }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); var chart23Chart = document.getElementById("chart23").getContext("2d"); myChart23 = new Chart(chart23Chart, { type: "doughnut", data: { datasets: [ { data: [ typeData.axis_type_count[1], typeData.axis_type_count[2], typeData.axis_type_count[3], typeData.axis_type_count[4] ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], // chartColors[4], ], }, ], labels: [ "روستایی", "فرعی", "اصلی", "شریانی", ], }, options: { onClick: (e) => { //console.log("hello seven"); var sevenPoint = myChartSeventh.getElementAtEvent(e); if (sevenPoint[0]) { var label = myChartSeventh.data.labels[sevenPoint[0]._index]; var value = myChartSeventh.data.datasets[0].data[sevenPoint[0]._index]; //console.log("roye mood ane 7"); //console.log(label); //console.log(value); } }, // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }] // }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); var FirstChart = document.getElementById("myChartfirst").getContext("2d"); var myChartFirst = new Chart(FirstChart, { type: "bar", data: { datasets: [ { data: [ typeData.counts.tollhouse_management_count, typeData.counts.technical_building_count, typeData.counts.upgrade_safety_count, typeData.counts.danger_prevention_count, typeData.counts.maintenance_project_count, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], chartColors[4], ], }, ], labels: [ "راهدارخانه (بهسازی و نوسازی)", "ابنیه فنی (نگهداری و ساخت )", "ارتقای ایمنی راه ", " رفع نقاط حادثه خیز / پرتصادف", "روکش آسفالت (نگهداری راه )", ], }, options: { onClick: (e) => { var firstPoint = myChartFirst.getElementAtEvent(e); if (firstPoint[0]) { var label = myChartFirst.data.labels[firstPoint[0]._index]; var value = myChartFirst.data.datasets[0].data[firstPoint[0]._index]; //console.log("roye mood ane"); //console.log(label); //console.log(value); } }, scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { display: false //this will remove only the label } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); var SecondChart = document.getElementById("myChartSecond").getContext("2d"); var myChartSecond = new Chart(SecondChart, { type: "bar", data: { datasets: [ { data: [ typeData.project_status[8], typeData.project_status[7], typeData.project_status[6], typeData.project_status[5], typeData.project_status[4], typeData.project_status[3], typeData.project_status[2], typeData.project_status[1], typeData.project_status[0], ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], chartColors[4], chartColors[5], chartColors[6], chartColors[7], chartColors[8], ], } ], labels: [ "تکمیل و خاتمه یافته و بهره برداری شده ", "در حال آماده سازی برای افتتاح", "در حال اجرا متوقف", "در حال اجرا /فعال", "در حال تجهیز کارگاه", "در دست مناقصه", "در دست مطالعه و تهیه اسناد مناقصه", "در دست برنامه ریزی اولیه", "توسط استان بروزرسانی نشده ", ], }, options: { onClick: (e) => { var secondPoint = myChartSecond.getElementAtEvent(e); if (secondPoint[0]) { var label = myChartSecond.data.labels[secondPoint[0]._index]; var value = myChartSecond.data.datasets[0].data[secondPoint[0]._index]; //console.log("roye mood ane 2"); //console.log(label); //console.log(value); } }, scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { display: false //this will remove only the label } }] }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#ff9999", // }, // }, responsive: true, // legend: { // display: true, // position: "right", // rtl: true, // labels: { // boxWidth: 13 // } // }, legend: { display: false, position: "left", labels: { boxWidth: 13 } }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); changeChartData(myChartSixth, sortableVal, sortableColor, sortableProvince) var SeventhChart = document.getElementById("myChartSeventh").getContext("2d"); var myChartSeventh = new Chart(SeventhChart, { type: "doughnut", data: { datasets: [ { data: [ typeData.axis_type_count[1], typeData.axis_type_count[2], typeData.axis_type_count[3], typeData.axis_type_count[4] ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], // chartColors[4], ], }, ], labels: [ "روستایی", "فرعی", "اصلی", "شریانی", ], }, options: { onClick: (e) => { //console.log("hello seven"); var sevenPoint = myChartSeventh.getElementAtEvent(e); if (sevenPoint[0]) { var label = myChartSeventh.data.labels[sevenPoint[0]._index]; var value = myChartSeventh.data.datasets[0].data[sevenPoint[0]._index]; //console.log("roye mood ane 7"); //console.log(label); //console.log(value); } }, // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }] // }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); rahdariPercent = typeData.avg[0].ag / 100; bar.animate(rahdariPercent); //console.log("moze",rahdariPercent); removeFeaturesFromMap(); $.ajax({ url: "https://rms.rmto.ir/api/provinces35geojsonbi", type: "GET", success: function (response) { iranGeoJSON = JSON.parse(response); // setTimeout(() => { iranMapGeo = L.geoJson(iranGeoJSON, { style: initStyleMapFeatures, onEachFeature: onEachFeature, }); iranMapGeo.addTo(map); // }, 2000); }, }); $.ajax({ url: "https://141.ir/api/cities430geojson", type: "GET", success: function (response) { fullCityGeoJSON = JSON.parse(response); }, }); } function ShowBiO(res) { var pahne = res.pahne pahneArray = [] sortable2 = pahne; var sortableVal = []; var sortableProvince = [] console.log("yani chi", sortable2); for (var i = 0; i < pahne.length; i++) { // console.log("koko", pahne[i]); pahne[i].province_name = provincesArray[i].name_fa; pahneArray.push(pahne[i]["total"]); } // pahne.forEach( function (element , index) { // console.log("elementor" , element); // element.province_name = provincesArray[index-1].name_fa; // pahneArray.push(element["total"]); // }); sortable2.sort(function (a, b) { return b["total"] - a["total"]; }); console.log("kiffff", sortable2); for (var index in sortable2) { sortableVal.push(sortable2[index]["total"]) sortableProvince.push(sortable2[index]["province_name"]) } minOfPahne = parseInt(sortable2[sortable2.length - 1]["total"]) maxOfPahne = parseInt(sortable2[0]["total"]) damaneh = maxOfPahne - minOfPahne charak = Math.round(damaneh / 3) // console.log("min" , minOfPahne); // console.log("max" , maxOfPahne); // console.log("damaneh" , damaneh); // console.log("charak" , charak); charakAval = minOfPahne + charak; charakDovom = maxOfPahne - charak; console.log("charakAval", charakAval); console.log("charakDovom", charakDovom); var sortableColor = [] var color; for (var index in sortable2) { // //console.log("winakan" ,sortable[index][1]); color = null; if (sortable2[index]["total"] <= charakAval) { // color = "#ff704d" sortableColor.push("#ff704d") } else if (sortable2[index]["total"] < charakDovom) { // color = "#ffeda0"; sortableColor.push("#ffeda0") } else { // color = "#66cc66"; sortableColor.push("#66cc66") } // sortable2[index]["clr"] = color } var new_pahne = sortable.sort(function (a, b) { return a[0] - b[0]; }); $('.counter').each(function () { //console.log("logi", $(this)[0].id ); var countTo; if ($(this)[0].id == "counter1") { countTo = res.counts.rahdari; } else if ($(this)[0].id == "counter2") { countTo = res.counts.items; } else if ($(this)[0].id == "counter3") { countTo = res.counts.patrols; } else if ($(this)[0].id == "counter4") { countTo = res.counts.observds.ok; } else { var countTo = 2222; } var $this = $(this); $({ countNum: $this.text() }).animate({ countNum: countTo }, { duration: 3000, easing: 'linear', step: function () { $this.text(Math.floor(this.countNum)); }, complete: function () { $this.text(this.countNum); } }); }); changeChartData(myChartSixth, sortableVal, sortableColor, sortableProvince) // var jariChart = document.getElementById("myChartJari").getContext("2d"); // var myChartJari = new Chart(jariChart, { // type: "doughnut", // data: { // datasets: [ // { // data: [ // 1944, // 1392, // 788, // 1141 // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[3], // // chartColors[4], // ], // }, // ], // labels: [ // "روستایی", // "فرعی", // "اصلی", // "شریانی", // ], // }, // options: { // onClick: (e) => { // //console.log("hello seven"); // var sevenPoint = myChartSeventh.getElementAtEvent(e); // if (sevenPoint[0]) { // var label = myChartSeventh.data.labels[sevenPoint[0]._index]; // var value = myChartSeventh.data.datasets[0].data[sevenPoint[0]._index]; // //console.log("roye mood ane 7"); // //console.log(label); // //console.log(value); // } // }, // // scales: { // // yAxes: [{ // // ticks: { // // suggestedMin: 0, // // suggestedMax: 1017 // // } // // }] // // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: true, // }, // }, // }); // var jariChartSecond = document.getElementById("myChartJariSecond").getContext("2d"); // var myChartJariSecond = new Chart(jariChartSecond, { // type: "bar", // data: { // datasets: [ // { // data: [ // 1920, // 508, // 210, // 1100, // 1425, // 250, // 720, // 1850, // 740, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[3], // chartColors[4], // chartColors[5], // chartColors[6], // chartColors[7], // chartColors[8], // ], // } // ], // labels: [ // "تکمیل و خاتمه یافته و بهره برداری شده ", // "در حال آماده سازی برای افتتاح", // "در حال اجرا متوقف", // "در حال اجرا /فعال", // "در حال تجهیز کارگاه", // "در دست مناقصه", // "در دست مطالعه و تهیه اسناد مناقصه", // "در دست برنامه ریزی اولیه", // "توسط استان بروزرسانی نشده ", // ], // }, // options: { // onClick: (e) => { // var secondPoint = myChartSecond.getElementAtEvent(e); // if (secondPoint[0]) { // var label = myChartSecond.data.labels[secondPoint[0]._index]; // var value = myChartSecond.data.datasets[0].data[secondPoint[0]._index]; // //console.log("roye mood ane 2"); // //console.log(label); // //console.log(value); // } // }, // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }], // xAxes: [{ // ticks: { // display: false //this will remove only the label // } // }] // }, // // plugins: { // // datalabels: { // // anchor: "center", // // align: "center", // // offset: 10, // // color: "#ff9999", // // }, // // }, // responsive: true, // // legend: { // // display: true, // // position: "right", // // rtl: true, // // labels: { // // boxWidth: 13 // // } // // }, // legend: { // display: false, // position: "left", // labels: { // boxWidth: 13 // } // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: true, // }, // }, // }); // rahdariPercent = typeData.avg[0].ag/100; // bar.animate(rahdariPercent); //console.log("moze",rahdariPercent); removeFeaturesFromMap(); iranArrayCount = 0; $.ajax({ url: "https://rms.rmto.ir/api/provinces35geojsonbi", type: "GET", success: function (response) { iranGeoJSON = JSON.parse(response); // setTimeout(() => { iranMapGeo = L.geoJson(iranGeoJSON, { style: initStyleMapFeatures, onEachFeature: onEachFeature, }); iranMapGeo.addTo(map); // }, 2000); }, }); $.ajax({ url: "https://141.ir/api/cities430geojson", type: "GET", success: function (response) { fullCityGeoJSON = JSON.parse(response); }, }); } function ShowBiS(res) { var pahne = res.pahne pahneArray = [] sortable2 = pahne; var sortableVal = []; var sortableProvince = [] // console.log("yani chi" , provincesArray); for (var i = 0; i < pahne.length; i++) { if (indexCol == 1) { pahneArray.push(pahne[i]["cnt"]); } else { pahneArray.push(pahne[i]["total"]); } } // pahne.forEach( function (element , index) { // console.log("elementor" , element); // element.province_name = provincesArray[index-1].name_fa; // pahneArray.push(element["total"]); // }); if (indexCol == 1) { sortable2.sort(function (a, b) { return b["cnt"] - a["cnt"]; }); } else { sortable2.sort(function (a, b) { return b["total"] - a["total"]; }); } console.log("kiffff", sortable2); for (var index in sortable2) { if (indexCol == 1) { sortableVal.push(sortable2[index]["cnt"]) } else { sortableVal.push(sortable2[index]["total"]) } sortableProvince.push(sortable2[index]["city_fa"]) } if (indexCol == 1) { minOfPahne = parseInt(sortable2[sortable2.length - 1]["cnt"]) maxOfPahne = parseInt(sortable2[0]["cnt"]) } else { minOfPahne = parseInt(sortable2[sortable2.length - 1]["total"]) maxOfPahne = parseInt(sortable2[0]["total"]) } damaneh = maxOfPahne - minOfPahne charak = Math.round(damaneh / 3) console.log("min", minOfPahne); console.log("max", maxOfPahne); console.log("damaneh", damaneh); console.log("charak", charak); charakAval = minOfPahne + charak; charakDovom = maxOfPahne - charak; console.log("charakAval", charakAval); console.log("charakDovom", charakDovom); var sortableColor = [] var color; for (var index in sortable2) { // //console.log("winakan" ,sortable[index][1]); color = null; if (indexCol == 1) { if (sortable2[index]["cnt"] <= charakAval) { // color = "#ff704d" sortableColor.push("#ff704d") } else if (sortable2[index]["cnt"] < charakDovom) { // color = "#ffeda0"; sortableColor.push("#ffeda0") } else { // color = "#66cc66"; sortableColor.push("#66cc66") } } else { if (sortable2[index]["total"] <= charakAval) { // color = "#ff704d" sortableColor.push("#ff704d") } else if (sortable2[index]["total"] < charakDovom) { // color = "#ffeda0"; sortableColor.push("#ffeda0") } else { // color = "#66cc66"; sortableColor.push("#66cc66") } } // sortable2[index]["clr"] = color } var new_pahne = sortable.sort(function (a, b) { return a[0] - b[0]; }); $('.counter').each(function () { //console.log("logi", $(this)[0].id ); var countTo; if ($(this)[0].id == "counter1") { countTo = res.counts.rahdari; } else if ($(this)[0].id == "counter2") { countTo = res.counts.items; } else if ($(this)[0].id == "counter3") { countTo = res.counts.patrols; } else if ($(this)[0].id == "counter4") { countTo = res.counts.observds.ok; } else { var countTo = 2222; } var $this = $(this); $({ countNum: $this.text() }).animate({ countNum: countTo }, { duration: 3000, easing: 'linear', step: function () { $this.text(Math.floor(this.countNum)); }, complete: function () { $this.text(this.countNum); } }); }); changeChartData(myChartSixth, sortableVal, sortableColor, sortableProvince) // var jariChart = document.getElementById("myChartJari").getContext("2d"); // var myChartJari = new Chart(jariChart, { // type: "doughnut", // data: { // datasets: [ // { // data: [ // 1944, // 1392, // 788, // 1141 // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[3], // // chartColors[4], // ], // }, // ], // labels: [ // "روستایی", // "فرعی", // "اصلی", // "شریانی", // ], // }, // options: { // onClick: (e) => { // //console.log("hello seven"); // var sevenPoint = myChartSeventh.getElementAtEvent(e); // if (sevenPoint[0]) { // var label = myChartSeventh.data.labels[sevenPoint[0]._index]; // var value = myChartSeventh.data.datasets[0].data[sevenPoint[0]._index]; // //console.log("roye mood ane 7"); // //console.log(label); // //console.log(value); // } // }, // // scales: { // // yAxes: [{ // // ticks: { // // suggestedMin: 0, // // suggestedMax: 1017 // // } // // }] // // }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#fffff", // }, // }, // responsive: true, // legend: { // display: false, // position: "left", // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: true, // }, // }, // }); // var jariChartSecond = document.getElementById("myChartJariSecond").getContext("2d"); // var myChartJariSecond = new Chart(jariChartSecond, { // type: "bar", // data: { // datasets: [ // { // data: [ // 1920, // 508, // 210, // 1100, // 1425, // 250, // 720, // 1850, // 740, // ], // backgroundColor: [ // chartColors[0], // chartColors[1], // chartColors[2], // chartColors[3], // chartColors[4], // chartColors[5], // chartColors[6], // chartColors[7], // chartColors[8], // ], // } // ], // labels: [ // "تکمیل و خاتمه یافته و بهره برداری شده ", // "در حال آماده سازی برای افتتاح", // "در حال اجرا متوقف", // "در حال اجرا /فعال", // "در حال تجهیز کارگاه", // "در دست مناقصه", // "در دست مطالعه و تهیه اسناد مناقصه", // "در دست برنامه ریزی اولیه", // "توسط استان بروزرسانی نشده ", // ], // }, // options: { // onClick: (e) => { // var secondPoint = myChartSecond.getElementAtEvent(e); // if (secondPoint[0]) { // var label = myChartSecond.data.labels[secondPoint[0]._index]; // var value = myChartSecond.data.datasets[0].data[secondPoint[0]._index]; // //console.log("roye mood ane 2"); // //console.log(label); // //console.log(value); // } // }, // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }], // xAxes: [{ // ticks: { // display: false //this will remove only the label // } // }] // }, // // plugins: { // // datalabels: { // // anchor: "center", // // align: "center", // // offset: 10, // // color: "#ff9999", // // }, // // }, // responsive: true, // // legend: { // // display: true, // // position: "right", // // rtl: true, // // labels: { // // boxWidth: 13 // // } // // }, // legend: { // display: false, // position: "left", // labels: { // boxWidth: 13 // } // }, // title: { // display: false, // text: "تفکیک پروژه های راه روستایی", // position: "bottom", // }, // tooltips: { // enabled: true, // }, // }, // }); // rahdariPercent = typeData.avg[0].ag/100; // bar.animate(rahdariPercent); //console.log("moze",rahdariPercent); removeFeaturesFromMap(); iranArrayCount = 0; // $.ajax({ // url: "https://rms.rmto.ir/api/provinces35geojsonbi", // type: "GET", // success: function (response) { // iranGeoJSON = JSON.parse(response); // // setTimeout(() => { // iranMapGeo = L.geoJson(iranGeoJSON, { // style: initStyleMapFeatures, // onEachFeature: onEachFeature, // }); // iranMapGeo.addTo(map); // // }, 2000); // }, // }); $.ajax({ url: "https://141.ir/api/cities430geojson", type: "GET", success: function (response) { fullCityGeoJSON = JSON.parse(response); }, }); } function showProgressBar() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("پیشرفت فیزیکی کل پروژه ها") $("#modalCenter .modal-body").append(`
`); var progressBar = document.getElementById("progressBarModal") var bar = new ProgressBar.SemiCircle(progressBar, { strokeWidth: 20, color: '#FFEA82', trailColor: '#FFEA82', trailWidth: 20, easing: 'easeInOut', duration: 1400, svgStyle: null, text: { value: '', alignToBottom: false }, from: { color: '#FFEA82' }, to: { color: '#ED6A5A' }, // Set default step function for all animate calls step: (state, bar) => { bar.path.setAttribute('stroke', state.color); var value = Math.round(bar.value() * 100); if (value === 0) { bar.setText(''); } else { bar.setText(value); } bar.text.style.color = state.color; } }); bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif'; bar.text.style.fontSize = '5rem'; bar.animate(0.67); // Number from 0.0 to 1.0 $('#modalCenter').modal('show') } function showFirstChModal() { // $('#modalCenter .modal-body').append($("#myChartfirst").clone()) // $("#myChartfirst").clone().appendTo('#modalCenter .modal-body'); $("#exampleModalLongTitle").html("پروژه های راهداری به تفکیک") $("#modalCenter .modal-body").empty(); $("#modalCenter .modal-body").append(``); var FirstChart = document.getElementById("myChartfirstModal").getContext("2d"); var myChartFirst = new Chart(FirstChart, { type: "bar", data: { datasets: [ { label: "راهدارخانه (بهسازی و نوسازی)", data: [resu.counts.tollhouse_management_count], backgroundColor: chartColors[0], }, { label: "ابنیه فنی (نگهداری و ساخت )", data: [resu.counts.technical_building_count], backgroundColor: chartColors[1], }, { label: "ارتقای ایمنی راه ", data: [resu.counts.upgrade_safety_count], backgroundColor: chartColors[2], }, { label: "رفع نقاط حادثه خیز / پرتصادف", data: [resu.counts.danger_prevention_count], backgroundColor: chartColors[3], }, { label: "روکش آسفالت (نگهداری راه )", data: [resu.counts.maintenance_project_count], backgroundColor: chartColors[4], }, ], labels: "", }, options: { onClick: (e) => { var firstPoint = myChartFirst.getElementAtEvent(e); if (firstPoint[0]) { var label = myChartFirst.data.labels[firstPoint[0]._index]; var value = myChartFirst.data.datasets[0].data[firstPoint[0]._index]; //console.log("roye mood ane"); //console.log(label); //console.log(value); } }, scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { display: false //this will remove only the label } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: true, position: "left", labels: { boxWidth: 13 } }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); // //console.log("gireha",$("#myChartfirst")); // //console.log("mireha",$("#myChartfirst").clone()); $('#modalCenter').modal('show') } function showSecondChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("آخرین وضعیت پروژه ها") $("#modalCenter .modal-body").append(``); var SecondChart = document.getElementById("myChartSecondModal").getContext("2d"); var myChartSecond = new Chart(SecondChart, { type: "bar", data: { datasets: [ { data: [ resu.project_status[8], ], backgroundColor: chartColors[0], label: "تکمیل و خاتمه یافته و بهره برداری شده ", }, { data: [ resu.project_status[7], ], backgroundColor: chartColors[1], label: "در حال آماده سازی برای افتتاح", }, { data: [ resu.project_status[6], ], backgroundColor: chartColors[2], label: "در حال اجرا متوقف", }, { data: [ resu.project_status[5], ], backgroundColor: chartColors[3], label: "در حال اجرا /فعال", }, { data: [ resu.project_status[4], ], backgroundColor: chartColors[4], label: "در حال تجهیز کارگاه", }, { data: [ resu.project_status[3], ], backgroundColor: chartColors[5], label: "در دست مناقصه", }, { data: [ resu.project_status[2], ], backgroundColor: chartColors[6], label: "در دست مطالعه و تهیه اسناد مناقصه", }, { data: [ resu.project_status[1], ], backgroundColor: chartColors[7], label: "در دست برنامه ریزی اولیه", }, { data: [ resu.project_status[0], ], backgroundColor: chartColors[8], label: "توسط استان بروزرسانی نشده ", } ], // labels: [ // ], }, options: { scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { display: false //this will remove only the label } }] }, // plugins: { // datalabels: { // anchor: "center", // align: "center", // offset: 10, // color: "#ff9999", // }, // }, responsive: true, // legend: { // display: true, // position: "right", // rtl: true, // labels: { // boxWidth: 13 // } // }, legend: { display: true, position: "left", labels: { boxWidth: 13 } }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); $('#modalCenter').modal('show') } function showThirdChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("استان با پیشرفت فیزیکی برتر") $("#modalCenter .modal-body").append(` `); var ThirdChart = document.getElementById("myChartThirdModal").getContext("2d"); var myChartThird = new Chart(ThirdChart, { type: "horizontalBar", data: { datasets: [ { data: [ 100, 98, 87, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], ], label: "hey" }, ], labels: [ "", "", "", ], }, options: { scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); $('#modalCenter').modal('show') } function showForthChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("ماموریت روزانه") $("#modalCenter .modal-body").append(``); var ForthChart = document.getElementById("myChartForthModal").getContext("2d"); var myChartForth = new Chart(ForthChart, { type: "horizontalBar", data: { datasets: [ { data: [ 127, 110, 95, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], ], label: "hey" }, ], labels: [ "", "", "", ], }, options: { scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); $('#modalCenter').modal('show'); } function showFifthChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("آخرین وضعیت محور های مسدودی و آسیب دیده") $("#modalCenter .modal-body").append(``); var FifthChart = document.getElementById("myChartFifthModal").getContext("2d"); var myChartFifth = new Chart(FifthChart, { type: "bar", data: { datasets: [ { data: [ 127, 110, 95, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], ], label: "hey" }, { data: [ 127, 110, 95, ], backgroundColor: [ chartColors[3], chartColors[4], chartColors[5], ], label: "hey" }, { data: [ 127, 110, 95, ], backgroundColor: [ chartColors[6], chartColors[7], chartColors[8], ], label: "hey" }, { data: [ 127, 110, 95, ], backgroundColor: [ chartColors[9], chartColors[10], chartColors[11], ], label: "hey" }, ], labels: [ "", "", "", ], }, options: { scales: { yAxes: [{ stacked: true, ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ stacked: true, ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); $('#modalCenter').modal('show') } function showSixthChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("فعالیت های روزانه") $("#modalCenter .modal-body").append(``); var SixthChart = document.getElementById("myChartSixthModal").getContext("2d"); var myChartSixth = new Chart(SixthChart, { type: "horizontalBar", data: { datasets: [ { data: [ 711, 605, 511, 309, 220, 198, 178, 136, 135, 134, 118, 109, 97, 87, 65, 45, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], chartColors[4], chartColors[5], chartColors[6], chartColors[7], chartColors[8], chartColors[9], chartColors[10], chartColors[11], chartColors[12], chartColors[0], chartColors[1], chartColors[2], ], label: "hey" }, ], labels: [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ], }, options: { scales: { yAxes: [{ ticks: { suggestedMin: 0, suggestedMax: 1017 } }], xAxes: [{ ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); $('#modalCenter').modal('show') } function showSeventhChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("فعالیت های روزانه به تفکیک زیرآیتم") $("#modalCenter .modal-body").append(``); var SeventhChart = document.getElementById("myChartSeventhModal").getContext("2d"); var myChartSeventh = new Chart(SeventhChart, { type: "doughnut", data: { datasets: [ { data: [ 311, 1211, 609, 514, 1017, ], backgroundColor: [ chartColors[0], chartColors[1], chartColors[2], chartColors[3], chartColors[4], ], }, ], labels: [ "راهدارخانه (بهسازی و نوسازی)", "ابنیه فنی (نگهداری و ساخت )", "رفع نقاط حادثه خیز / پرتصادف", "ارتقای ایمنی راه ", "روکش آسفالت (نگهداری راه )", ], }, options: { // scales: { // yAxes: [{ // ticks: { // suggestedMin: 0, // suggestedMax: 1017 // } // }] // }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: true, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: true, }, }, }); $('#modalCenter').modal('show') } function showEightNinthChModal() { $("#modalCenter .modal-body").empty(); $("#exampleModalLongTitle").html("استان برتر و استان ضعیف در رسیدگی به شکایات") $("#modalCenter .modal-body").append(``); $("#modalCenter .modal-body").append(``); var EighthChart = document.getElementById("myChartEighthModal").getContext("2d"); var myChartEighth = new Chart(EighthChart, { type: "bar", data: { datasets: [ { data: [ -16, -30, 60, ], backgroundColor: [ chartColors[0], chartColors[1], ], label: "hey" }, { data: [ 127, 110, ], backgroundColor: [ chartColors[2], chartColors[3], ], label: "hey" }, ], labels: [ "", "", ], }, options: { scales: { yAxes: [{ stacked: true, ticks: { suggestedMin: 0, suggestedMax: 100 } }], xAxes: [{ stacked: true, ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); var NinthChart = document.getElementById("myChartNinthModal").getContext("2d"); var myChartNinth = new Chart(NinthChart, { type: "bar", data: { datasets: [ { data: [ -50, -80, ], backgroundColor: [ chartColors[4], chartColors[5], ], label: "hey" }, { data: [ 91, 19, ], backgroundColor: [ chartColors[6], chartColors[7], ], label: "hey" }, ], labels: [ "", "", ], }, options: { scales: { yAxes: [{ stacked: true, ticks: { suggestedMin: 0, suggestedMax: 100 } }], xAxes: [{ stacked: true, ticks: { min: 0 } }] }, plugins: { datalabels: { anchor: "center", align: "center", offset: 10, color: "#fffff", }, }, responsive: true, legend: { display: false, position: "left", }, title: { display: false, text: "تفکیک پروژه های راه روستایی", position: "bottom", }, tooltips: { enabled: false, }, }, }); $('#modalCenter').modal('show') } function showFirstMapModal() { $("#mapModalCenter .modal-body").empty(); $("#mapModalCenter .modal-body").append(`