|
|
// 长春市教育发展--近三年办学条件发展状况
|
|
|
|
|
|
$(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_01_sjxsmj();
|
|
|
|
|
|
// 生均占地面积情况
|
|
|
echarts_02_sjjzmj();
|
|
|
|
|
|
// 生均运动场地面积情况
|
|
|
echarts_03_sjydcdmj();
|
|
|
|
|
|
// 生均教学教辅面积情况
|
|
|
echarts_04_sjjxjfdmj();
|
|
|
|
|
|
// 寄宿生生均宿舍面积情况
|
|
|
echarts_05_jsssjssmjdmj();
|
|
|
// 整体情况
|
|
|
|
|
|
|
|
|
|
|
|
// 生均校舍建筑面积情况
|
|
|
function echarts_01_sjxsmj() {
|
|
|
|
|
|
|
|
|
// console.log(getData(), 'test111111')
|
|
|
var data2018 = []
|
|
|
$.when(
|
|
|
getData('A022', '2018', 'json'),
|
|
|
getData('A022', '2019', 'json'),
|
|
|
getData('A022', '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 xx = ['小学']
|
|
|
const cz = ['初中']
|
|
|
const gz = ['高中']
|
|
|
|
|
|
|
|
|
let [xx_student_number, xx_total, cz_student_number, cz_total, gz_student_number, gz_total] = [0, 0, 0, 0, 0, 0];
|
|
|
|
|
|
data2018.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2019.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2020.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
|
|
|
|
|
|
const datatest = [
|
|
|
product,
|
|
|
xx,
|
|
|
cz,
|
|
|
gz
|
|
|
]
|
|
|
|
|
|
// console.log(year, 'year', config_years)
|
|
|
// 基于准备好的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_02_sjjzmj() {
|
|
|
|
|
|
|
|
|
// console.log(getData(), 'test111111')
|
|
|
var data2018 = []
|
|
|
$.when(
|
|
|
getData('A021', '2018', 'json'),
|
|
|
getData('A021', '2019', 'json'),
|
|
|
getData('A021', '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 xx = ['小学']
|
|
|
const cz = ['初中']
|
|
|
const gz = ['高中']
|
|
|
|
|
|
|
|
|
let [xx_student_number, xx_total, cz_student_number, cz_total, gz_student_number, gz_total] = [0, 0, 0, 0, 0, 0];
|
|
|
|
|
|
data2018.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2019.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2020.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).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
|
|
|
},
|
|
|
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_03_sjydcdmj() {
|
|
|
|
|
|
|
|
|
// console.log(getData(), 'test111111')
|
|
|
var data2018 = []
|
|
|
$.when(
|
|
|
getData('A020', '2018', 'json'),
|
|
|
getData('A020', '2019', 'json'),
|
|
|
getData('A020', '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 xx = ['小学']
|
|
|
const cz = ['初中']
|
|
|
const gz = ['高中']
|
|
|
|
|
|
|
|
|
let [xx_student_number, xx_total, cz_student_number, cz_total, gz_student_number, gz_total] = [0, 0, 0, 0, 0, 0];
|
|
|
|
|
|
data2018.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2019.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2020.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
|
|
|
|
|
|
const datatest = [
|
|
|
product,
|
|
|
xx,
|
|
|
cz,
|
|
|
gz
|
|
|
]
|
|
|
|
|
|
// 基于准备好的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
|
|
|
},
|
|
|
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_04_sjjxjfdmj() {
|
|
|
|
|
|
|
|
|
// console.log(getData(), 'test111111')
|
|
|
var data2018 = []
|
|
|
$.when(
|
|
|
getData('A019', '2018', 'json'),
|
|
|
getData('A019', '2019', 'json'),
|
|
|
getData('A019', '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 xx = ['小学']
|
|
|
const cz = ['初中']
|
|
|
const gz = ['高中']
|
|
|
|
|
|
|
|
|
let [xx_student_number, xx_total, cz_student_number, cz_total, gz_student_number, gz_total] = [0, 0, 0, 0, 0, 0];
|
|
|
|
|
|
data2018.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2019.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
xx_student_number = 0;
|
|
|
xx_total = 0;
|
|
|
cz_student_number = 0;
|
|
|
cz_total = 0;
|
|
|
gz_student_number = 0;
|
|
|
gz_total = 0;
|
|
|
data2020.map((e, i) => {
|
|
|
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_student_number = Number(e.studentno) + xx_student_number;
|
|
|
xx_total = Number(e.total) + xx_total;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_student_number = Number(e.studentno) + cz_student_number;
|
|
|
cz_total = Number(e.total) + cz_total;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_student_number = Number(e.studentno) + gz_student_number;
|
|
|
gz_total = Number(e.total) + gz_total;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_total / xx_student_number).toFixed(2))
|
|
|
cz.push((cz_total / cz_student_number).toFixed(2))
|
|
|
gz.push((gz_total / gz_student_number).toFixed(2))
|
|
|
|
|
|
|
|
|
|
|
|
const datatest = [
|
|
|
product,
|
|
|
xx,
|
|
|
cz,
|
|
|
gz
|
|
|
]
|
|
|
|
|
|
// 基于准备好的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
|
|
|
},
|
|
|
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_05_jsssjssmjdmj() {
|
|
|
|
|
|
|
|
|
// console.log(getData(), 'test111111')
|
|
|
var data2018 = []
|
|
|
$.when(
|
|
|
getData('A018', '2018', 'json'),
|
|
|
getData('A018', '2019', 'json'),
|
|
|
getData('A018', '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 xx = ['小学']
|
|
|
const cz = ['初中']
|
|
|
const gz = ['高中']
|
|
|
|
|
|
|
|
|
let [xx_jisuno, xx_xueshengsushe, cz_jisuno, cz_xueshengsushe, gz_jisuno, gz_xueshengsushe] = [0, 0, 0, 0, 0, 0];
|
|
|
|
|
|
data2018.map((e, i) => {
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_jisuno = Number(e.jisuno) + xx_jisuno;
|
|
|
xx_xueshengsushe = Number(e.xueshengsushe) + xx_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_jisuno = Number(e.jisuno) + cz_jisuno;
|
|
|
cz_xueshengsushe = Number(e.xueshengsushe) + cz_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_jisuno = Number(e.jisuno) + gz_jisuno;
|
|
|
gz_xueshengsushe = Number(e.xueshengsushe) + gz_xueshengsushe;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_xueshengsushe / xx_jisuno).toFixed(2))
|
|
|
cz.push((cz_xueshengsushe / cz_jisuno).toFixed(2))
|
|
|
gz.push((gz_xueshengsushe / gz_jisuno).toFixed(2))
|
|
|
|
|
|
xx_jisuno = 0;
|
|
|
xx_xueshengsushe = 0;
|
|
|
cz_jisuno = 0;
|
|
|
cz_xueshengsushe = 0;
|
|
|
gz_jisuno = 0;
|
|
|
gz_xueshengsushe = 0;
|
|
|
data2019.map((e, i) => {
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_jisuno = Number(e.jisuno) + xx_jisuno;
|
|
|
xx_xueshengsushe = Number(e.xueshengsushe) + xx_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_jisuno = Number(e.jisuno) + cz_jisuno;
|
|
|
cz_xueshengsushe = Number(e.xueshengsushe) + cz_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_jisuno = Number(e.jisuno) + gz_jisuno;
|
|
|
gz_xueshengsushe = Number(e.xueshengsushe) + gz_xueshengsushe;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_xueshengsushe / xx_jisuno).toFixed(2))
|
|
|
cz.push((cz_xueshengsushe / cz_jisuno).toFixed(2))
|
|
|
gz.push((gz_xueshengsushe / gz_jisuno).toFixed(2))
|
|
|
|
|
|
xx_jisuno = 0;
|
|
|
xx_xueshengsushe = 0;
|
|
|
cz_jisuno = 0;
|
|
|
cz_xueshengsushe = 0;
|
|
|
gz_jisuno = 0;
|
|
|
gz_xueshengsushe = 0;
|
|
|
data2020.map((e, i) => {
|
|
|
|
|
|
if (e.stage === "小学") {
|
|
|
xx_jisuno = Number(e.jisuno) + xx_jisuno;
|
|
|
xx_xueshengsushe = Number(e.xueshengsushe) + xx_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "初中") {
|
|
|
cz_jisuno = Number(e.jisuno) + cz_jisuno;
|
|
|
cz_xueshengsushe = Number(e.xueshengsushe) + cz_xueshengsushe;
|
|
|
}
|
|
|
if (e.stage === "高中") {
|
|
|
gz_jisuno = Number(e.jisuno) + gz_jisuno;
|
|
|
gz_xueshengsushe = Number(e.xueshengsushe) + gz_xueshengsushe;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
xx.push((xx_xueshengsushe / xx_jisuno).toFixed(2))
|
|
|
cz.push((cz_xueshengsushe / cz_jisuno).toFixed(2))
|
|
|
gz.push((gz_xueshengsushe / gz_jisuno).toFixed(2))
|
|
|
|
|
|
|
|
|
|
|
|
const datatest = [
|
|
|
product,
|
|
|
xx,
|
|
|
cz,
|
|
|
gz
|
|
|
]
|
|
|
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
var myChart = echarts.init(document.getElementById('echart5'));
|
|
|
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')
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|