// 长春市教育发展--教师队伍发展状况 $(function () { function getData(query_id, year, query_format) { return $.post(config_serverIp + "dataex/report/QuerySimpleGP", JSON.stringify({ "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": query_id, "query_param": [ year ] }, "query_cache": 0, "query_count": [ "studentno", "teacherno" ], "query_format": query_format, "query_group": [ "stage", "citycountrygroup" ] })) } // echarts_11(); // echarts_12(); // echarts_13(); // echarts_31(); // echarts_2(); // echarts_51(); // echarts_7(); // 整体情况 echarts_1(); echarts_2(); echarts_3("小学"); echarts_4("小学"); // 整体情况 // 专任教师职称情况 $("#btn_xx").click(function () { echarts_3("小学"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) $("#btn_cz").click(function () { echarts_3("初中"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) $("#btn_gz").click(function () { echarts_3("高中"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) // 专任教师学历情况 $("#btn_xx_xl").click(function () { echarts_4("小学"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) $("#btn_cz_xl").click(function () { echarts_4("初中"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) $("#btn_gz_xl").click(function () { echarts_4("高中"); $(this).siblings('a').css("color", '#3690ff'); $(this).css("color", 'white'); }) // 整体情况 function echarts_1() { // console.log(getData(), 'test111111') var data2018 = [] $.when( getData('A012', '2018', 'json'), getData('A012', '2019', 'json'), getData('A012', '2020', 'json') ).done(function (a1, a2, a3) { // console.log(JSON.parse(a1[0].result), 'test 2018') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) // console.log(JSON.parse(a2[0].result), 'test 2019') // console.log(JSON.parse(a3[0].result), 'test 2020') // console.log(data2018, 'data2018') const year = config_years const product = ['product'] year.map((e, i) => { product.push(e) }) const jzgzrs = ['教职工总人数'] const zbjszrs = ['在编教师总人数'] const zrjszrs = ['专任教师总人数'] data2018.map((e, i) => { e.didgroup === "教职工总人数" ? jzgzrs.push(e.total) : ""; e.didgroup === "在编教师总人数" ? zbjszrs.push(e.total) : ""; e.didgroup === "专任教师总人数" ? zrjszrs.push(e.total) : ""; }) data2019.map((e, i) => { e.didgroup === "教职工总人数" ? jzgzrs.push(e.total) : ""; e.didgroup === "在编教师总人数" ? zbjszrs.push(e.total) : ""; e.didgroup === "专任教师总人数" ? zrjszrs.push(e.total) : ""; }) data2020.map((e, i) => { e.didgroup === "教职工总人数" ? jzgzrs.push(e.total) : ""; e.didgroup === "在编教师总人数" ? zbjszrs.push(e.total) : ""; e.didgroup === "专任教师总人数" ? zrjszrs.push(e.total) : ""; }) // data2018.map((e, i) => { // if (e.didgroup != "女教职工总人数") { // jzgzrs.push(e.total) // } // console.log(e, i, 'data2018') // }) const datatest = [ product, jzgzrs, zbjszrs, zrjszrs ] // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart1')); option = { legend: { orient: 'horizontal', x: 'center', textStyle: { color: "rgba(255,255,255,.6)", }, top: 0, data: year }, label: { show: true, position: 'top', valueAnimation: true }, grid: { left: '0%', top: '5%', right: '0%', bottom: '5%', containLabel: true }, tooltip: {}, dataset: { source: datatest }, xAxis: { type: 'category', axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1)", width: 1, type: "solid" }, }, axisTick: { show: false, }, axisLabel: { interval: 0, // rotate:50, show: true, splitNumber: 15, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, }, yAxis: { axisLabel: { //formatter: '{value} %' show: true, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, axisTick: { show: false, }, axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1 )", width: 1, type: "solid" }, }, splitLine: { lineStyle: { color: "rgba(255,255,255,.1)", type: 'dashed' } } }, series: [ { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#168EFE', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#8882F7', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#FFA06C', opacity: 1, barBorderRadius: 5, } } } ] // Declare several bar series, each will be mapped // to a column of dataset.source by default. }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); window.addEventListener("resize", function () { myChart.resize(); }); }); // }, 'json') } // 专任教师数量情况(专任教师师生比) function echarts_2() { $.when( getData('A017', '2018', 'json'), getData('A017', '2019', 'json'), getData('A017', '2020', 'json') ).done(function (a1, a2, a3) { // console.log(JSON.parse(a1[0].result), 'test 2018') // console.log(JSON.parse(a2[0].result), 'test 2019') // console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) const year = config_years const product = ['product'] year.map((e, i) => { product.push(e) }) const xx = ['小学'] const cz = ['初中'] const gz = ['高中'] data2018.map((e, i) => { e.stage === "小学" ? xx.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "初中" ? cz.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "高中" ? gz.push((e.studentno / e.teacherno).toFixed(2)) : ""; }) data2019.map((e, i) => { e.stage === "小学" ? xx.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "初中" ? cz.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "高中" ? gz.push((e.studentno / e.teacherno).toFixed(2)) : ""; }) data2020.map((e, i) => { e.stage === "小学" ? xx.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "初中" ? cz.push((e.studentno / e.teacherno).toFixed(2)) : ""; e.stage === "高中" ? gz.push((e.studentno / e.teacherno).toFixed(2)) : ""; }) const datatest = [ product, xx, cz, gz ] // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart2')); // 城乡专任教师师生比 option = { legend: { orient: 'horizontal', x: 'center', textStyle: { color: "rgba(255,255,255,.6)", }, top: 0, data: year }, grid: { left: '0%', top: '5%', right: '0%', bottom: '5%', containLabel: true }, tooltip: {}, dataset: { source: datatest }, xAxis: { type: 'category', axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1)", width: 1, type: "solid" }, }, axisTick: { show: false, }, axisLabel: { interval: 0, // rotate:50, show: true, splitNumber: 15, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, }, yAxis: { axisLabel: { //formatter: '{value} %' show: true, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, axisTick: { show: false, }, axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1 )", width: 1, type: "solid" }, }, splitLine: { lineStyle: { color: "rgba(255,255,255,.1)", type: 'dashed' } } }, series: [ { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#168EFE', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#8882F7', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#FFA06C', opacity: 1, barBorderRadius: 5, } } } ] // Declare several bar series, each will be mapped // to a column of dataset.source by default. }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); window.addEventListener("resize", function () { myChart.resize(); }); // }, 'json') }); } function echarts_3(stage) { $.when( getData('A016', '2018', 'json'), getData('A016', '2019', 'json'), getData('A016', '2020', 'json') ).done(function (a1, a2, a3) { // console.log(JSON.parse(a1[0].result), 'test 2018') // console.log(JSON.parse(a2[0].result), 'test 2019') // console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) // cityNum.push(((item / newData.datas2[1][index])).toFixed(2)); const year = ['2019', '2020'] const product = ['product'] year.map((e, i) => { product.push(e) }) const zgj = ['正高级'] const fgj = ['副高级'] const zj = ['中级'] const zlj = ['助理级'] const yj = ['员级'] const wdj = ['未定职级'] data2019.map((e, i) => { e.didgroup === "正高级" && e.stage === stage ? zgj.push(e.teacherno) : ""; e.didgroup === "副高级" && e.stage === stage ? fgj.push(e.teacherno) : ""; e.didgroup === "中级" && e.stage === stage ? zj.push(e.teacherno) : ""; e.didgroup === "助理级" && e.stage === stage ? zlj.push(e.teacherno) : ""; e.didgroup === "员级" && e.stage === stage ? yj.push(e.teacherno) : ""; e.didgroup === "未定职级" && e.stage === stage ? wdj.push(e.teacherno) : ""; }) data2020.map((e, i) => { e.didgroup === "正高级" && e.stage === stage ? zgj.push(e.teacherno) : ""; e.didgroup === "副高级" && e.stage === stage ? fgj.push(e.teacherno) : ""; e.didgroup === "中级" && e.stage === stage ? zj.push(e.teacherno) : ""; e.didgroup === "助理级" && e.stage === stage ? zlj.push(e.teacherno) : ""; e.didgroup === "员级" && e.stage === stage ? yj.push(e.teacherno) : ""; e.didgroup === "未定职级" && e.stage === stage ? wdj.push(e.teacherno) : ""; }) const datatest = [ product, zgj, fgj, zj, zlj, yj, wdj ] // console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart3')); // 城乡专任教师师生比 option = { legend: { orient: 'horizontal', x: 'center', textStyle: { color: "rgba(255,255,255,.6)", }, top: 0, data: year }, label: { show: true, position: 'top', valueAnimation: true }, label: { show: true, position: 'top', valueAnimation: true }, grid: { left: '0%', top: '5%', right: '0%', bottom: '5%', containLabel: true }, tooltip: {}, dataset: { source: datatest }, xAxis: { type: 'category', axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1)", width: 1, type: "solid" }, }, axisTick: { show: false, }, axisLabel: { interval: 0, // rotate:50, show: true, splitNumber: 15, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, }, yAxis: { axisLabel: { //formatter: '{value} %' show: true, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, axisTick: { show: false, }, axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1 )", width: 1, type: "solid" }, }, splitLine: { lineStyle: { color: "rgba(255,255,255,.1)", type: 'dashed' } } }, series: [ { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#8882F7', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#FFA06C', opacity: 1, barBorderRadius: 5, } } }, ] // Declare several bar series, each will be mapped // to a column of dataset.source by default. }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); window.addEventListener("resize", function () { myChart.resize(); }); }); // }, 'json') } function echarts_4(stage) { // console.log(getData(), 'test111111') $.when( getData('A013', '2018', 'json'), getData('A013', '2019', 'json'), getData('A013', '2020', 'json') ).done(function (a1, a2, a3) { console.log(JSON.parse(a1[0].result), 'test 2018') console.log(JSON.parse(a2[0].result), 'test 2019') console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) console.log(data2018, data2019, data2020) const year = config_years const product = ['product'] year.map((e, i) => { product.push(e) }) const yjs = ['研究生毕业'] const bkby = ['本科毕业'] const zkby = ['专科毕业'] const gzjdby = ['高中阶段毕业'] const gzjdyxby = ['高中阶段以下毕业'] data2018.map((e, i) => { e.didgroup === "研究生毕业" && e.stage === stage ? yjs.push(e.teacherno) : ""; e.didgroup === "本科毕业" && e.stage === stage ? bkby.push(e.teacherno) : ""; e.didgroup === "专科毕业" && e.stage === stage ? zkby.push(e.teacherno) : ""; e.didgroup === "高中阶段毕业" && e.stage === stage ? gzjdby.push(e.teacherno) : ""; e.didgroup === "高中阶段以下毕业" && e.stage === stage ? gzjdyxby.push(e.teacherno) : ""; }) data2019.map((e, i) => { e.didgroup === "研究生毕业" && e.stage === stage ? yjs.push(e.teacherno) : ""; e.didgroup === "本科毕业" && e.stage === stage ? bkby.push(e.teacherno) : ""; e.didgroup === "专科毕业" && e.stage === stage ? zkby.push(e.teacherno) : ""; e.didgroup === "高中阶段毕业" && e.stage === stage ? gzjdby.push(e.teacherno) : ""; e.didgroup === "高中阶段以下毕业" && e.stage === stage ? gzjdyxby.push(e.teacherno) : ""; }) data2020.map((e, i) => { e.didgroup === "研究生毕业" && e.stage === stage ? yjs.push(e.teacherno) : ""; e.didgroup === "本科毕业" && e.stage === stage ? bkby.push(e.teacherno) : ""; e.didgroup === "专科毕业" && e.stage === stage ? zkby.push(e.teacherno) : ""; e.didgroup === "高中阶段毕业" && e.stage === stage ? gzjdby.push(e.teacherno) : ""; e.didgroup === "高中阶段以下毕业" && e.stage === stage ? gzjdyxby.push(e.teacherno) : ""; }) const datatest = [ product, yjs, bkby, zkby, gzjdby, gzjdyxby ] console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart4')); // 城乡专任教师师生比 option = { legend: { orient: 'horizontal', x: 'center', textStyle: { color: "rgba(255,255,255,.6)", }, top: 0, data: year }, label: { show: true, position: 'top', valueAnimation: true }, label: { show: true, position: 'top', valueAnimation: true }, grid: { left: '0%', top: '5%', right: '0%', bottom: '5%', containLabel: true }, tooltip: {}, dataset: { source: datatest }, xAxis: { type: 'category', axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1)", width: 1, type: "solid" }, }, axisTick: { show: false, }, axisLabel: { interval: 0, // rotate:50, show: true, splitNumber: 15, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, }, yAxis: { axisLabel: { //formatter: '{value} %' show: true, textStyle: { color: "rgba(255,255,255,.6)", fontSize: '12', }, }, axisTick: { show: false, }, axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.1 )", width: 1, type: "solid" }, }, splitLine: { lineStyle: { color: "rgba(255,255,255,.1)", type: 'dashed' } } }, series: [ { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#168EFE', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#8882F7', opacity: 1, barBorderRadius: 5, } } }, { type: 'bar', barWidth: '15%', //柱子宽度 itemStyle: { normal: { color: '#FFA06C', opacity: 1, barBorderRadius: 5, } } } ] // Declare several bar series, each will be mapped // to a column of dataset.source by default. }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); window.addEventListener("resize", function () { myChart.resize(); }); }); } })