From 300e3363d6804c5185a4144c7c1e3308e7e0e3dc Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Wed, 10 Sep 2025 16:27:38 +0800 Subject: [PATCH] 'commit' --- Model/RuYuanZaiYuanCount.py | 144 +++++++----------- .../RuYuanZaiYuanCount.cpython-310.pyc | Bin 3558 -> 3110 bytes static/preschool_education.html | 92 +++++++++-- 3 files changed, 134 insertions(+), 102 deletions(-) diff --git a/Model/RuYuanZaiYuanCount.py b/Model/RuYuanZaiYuanCount.py index ce8a04e..4f72f43 100644 --- a/Model/RuYuanZaiYuanCount.py +++ b/Model/RuYuanZaiYuanCount.py @@ -39,118 +39,80 @@ class RuYuanZaiYuanModel: years = [str(year) for year in range(2015, 2025)] # 构建学前教育数据 - urban_enroll = [] # 城区入园人数 - town_enroll = [] # 镇区入园人数 - rural_enroll = [] # 乡村入园人数 - urban_in_school = [] # 城区在园人数 - town_in_school = [] # 镇区在园人数 - rural_in_school = [] # 乡村在园人数 + enroll_total = [] # 入园总数 + in_school_total = [] # 在园总数 for year in years: - # 入园人数(招生数据) - pre_enroll = yunnan_enroll.get("education_data", {}).get("preschool", {}).get(year, {}) - urban_enroll.append(pre_enroll.get("urban", 0)) - town_enroll.append(pre_enroll.get("town", 0)) - rural_enroll.append(pre_enroll.get("rural", 0)) + # 入园总数(招生数据) + enroll_data = yunnan_enroll["education_data"]["preschool"].get(year, {}) + enroll_total.append(enroll_data.get("total", 0)) - # 在园人数(在校生数据) - pre_in_school = yunnan_in_school.get("education_data", {}).get("preschool", {}).get(year, {}) - urban_in_school.append(pre_in_school.get("urban", 0)) - town_in_school.append(pre_in_school.get("town", 0)) - rural_in_school.append(pre_in_school.get("rural", 0)) + # 在园总数(在校生数据) + in_school_data = yunnan_in_school["student_data"]["preschool"].get(year, {}) + in_school_total.append(in_school_data.get("total", 0)) - # 构建option数据结构 + # 构建ECharts配置 option = { - "grid": { - "left": 0, - "right": 0, - "top": 40, - "bottom": 10, - "containLabel": True, - }, - "textStyle": { - "color": "#fff", + "title": { + "text": "云南省学前教育人数统计", + "left": "center", + "textStyle": {"color": "#333"} }, "tooltip": { "trigger": "axis", - "axisPointer": { - "type": "cross", - "crossStyle": { "color": "#999" }, - }, - "textStyle": { "color": "#fff" }, - "backgroundColor": "rgba(96,98,102,0.8)", - "borderColor": "rgba(255,255,255,0.3)", - "borderWidth": 1, + "axisPointer": {"type": "shadow"} }, "legend": { - "data": ["城区入园人数", "镇区入园人数", "乡村入园人数", - "城区在园人数", "镇区在园人数", "乡村在园人数"], - "top": 0, - "textStyle": { "color": "#fff" }, - "icon": "roundRect", - "itemWidth": 12, - "itemHeight": 12, + "data": ["入园总数", "在园总数"], + "top": 30, + "textStyle": {"color": "#333"} }, - "xAxis": [ - { - "type": "category", - "data": years, - "axisPointer": { "type": "shadow" }, - "axisLine": { "lineStyle": { "color": "#fff" } }, - "axisLabel": { "color": "#fff" }, - "nameTextStyle": { "color": "#fff" }, + "xAxis": { + "type": "category", + "data": years, + "axisLabel": {"color": "#333"}, + "axisLine": {"lineStyle": {"color": "#333"}} + }, + "yAxis": { + "type": "value", + "name": "人数", + "min": 0, + "max": 100, + "interval": 30, + "axisLabel": { + "formatter": "{value} 万人", + "color": "#333" }, - ], - "yAxis": [ - { - "type": "value", - "axisLabel": { "formatter": "{value} 人", "color": "#fff" }, - } - ], + "axisLine": {"lineStyle": {"color": "#333"}}, + "splitLine": {"lineStyle": {"color": "rgba(0,0,0,0.1)"}} + }, "series": [ { - "name": "城区入园人数", + "name": "入园总数", "type": "bar", - "data": urban_enroll, - "itemStyle": { "borderRadius": [6, 6, 0, 0] }, + "data": enroll_total, + "itemStyle": { + "color": "#5470c6", + "borderRadius": [4, 4, 0, 0] + }, + "barWidth": "40%" }, { - "name": "镇区入园人数", - "type": "bar", - "data": town_enroll, - "itemStyle": { "borderRadius": [6, 6, 0, 0] }, - }, - { - "name": "乡村入园人数", - "type": "bar", - "data": rural_enroll, - "itemStyle": { "borderRadius": [6, 6, 0, 0] }, - }, - { - "name": "城区在园人数", + "name": "在园总数", "type": "line", - "data": urban_in_school, - "yAxisIndex": 0, - "lineStyle": { "width": 3 }, - "symbolSize": 8, - }, - { - "name": "镇区在园人数", - "type": "line", - "data": town_in_school, - "yAxisIndex": 0, - "lineStyle": { "width": 3 }, - "symbolSize": 8, - }, - { - "name": "乡村在园人数", - "type": "line", - "data": rural_in_school, - "yAxisIndex": 0, - "lineStyle": { "width": 3 }, + "data": in_school_total, + "lineStyle": {"color": "#91cc75", "width": 3}, + "symbol": "circle", "symbolSize": 8, + "itemStyle": {"color": "#91cc75"} } ], + "grid": { + "left": "3%", + "right": "4%", + "bottom": "3%", + "containLabel": True + } } return option \ No newline at end of file diff --git a/Model/__pycache__/RuYuanZaiYuanCount.cpython-310.pyc b/Model/__pycache__/RuYuanZaiYuanCount.cpython-310.pyc index fa5029627e31c7f402cd7c779609dc94ec78f8f1..ed43353a8cf863debdfb9d92c2368dc00857fa5c 100644 GIT binary patch delta 1196 zcmZ8f%WoS+828T3K5fULn5Lo72fHxeBRFBx4igUIay^0noA|dwr4Q-{y_mk0d4F!xhzXd}8L*}^TQoL; z%r@CHV{J=|%`FNxWVgw-qGVzfa!;w0SVxuer0T;mGl@PNKmS9FKK40Vm-UVyEE@MxDTza$;Z;^KiC^rUF$gwvZT`R%|V0oW(>TfUf#R%&Am@=?e6UC zUAcMp&eeN2wuSCtfX{^HMPbCcbf!|NII5uBU+02`{sk^9=`Zn(&==HQ586m>tocH3 zH{2dX7abxD&VqU!vt%XzP87(Log6kW`0U5Qch~nW-NA|@Ao=MrFg%0`SxojTR35Fd zV~7aTbGcuS*oLsepyj8f9m?jAW2dCRl4Z`jHNO`MGxbp>w2$1d<9BpajJ7xgbUX4f zeVkI8M|OYt0x9g+x)8CZ%dt&1gM7EZ>NR(+d@>!U=N-pP%L&?Yo4!z+K?{w$F3fam zn2pV280(!yE3Ecf81VD52esz1t}(MvJy-S?9Xg~^^{O=ThEn5@w4}(@A_hKt*M*?d z?yA*t$e5&+3BKSpfat?ODa{|7lmx_$?NN;cEIuR|-LEwe2;cXbiB!n0_TY z*2p)||2F$Z?-HUpwWt;qlTf9oQk9}tB>T`WDnuiSuF!`>NBc;ByppJ`&Bie`CtD9vHW1K delta 1651 zcmZuw&2QX96t~A?uRrz!k}WATw1H9*mo((NS-1cNwUv56O{7XIh043*-54A@%+8W* zaO4x>f1uahs1bpm!sH3^B!rz!7r{ye)A1^VqcKnVE z5f?g`OaP`G!JY*ya|D|tm!~2fa+xMG5IRfdAdPu46&Xjci-19~@8#7sve3zF<)i$f zWS74F37aS`t4&&Q0xH7+moW?1gR)AS)bYDxfON%uSh7`)eYeKAO1=6D;|dGcxK;@n z3s-rz8V1bqf@@C2^|@LN{g7_rv$a}{V`sx_l+`K?8x4R;rIL*}X00{1Y$o6$i(9_C zIY{djXRI_oURoHRnw%b=oLI0oPbA><+}!vd&R_I4m}4B zoq&O34@%ArkGZQiJjkD$!o1=pXQNjg=GH^nqUQxyYpggVT<3=G1#VIqTT52xb3*Sz zEJ(Vj;WZ#|Be9Z`%mvP>yVS3z`j+E2-KGWnw-a+~1d0UbY1Bfx>M$rj6*tC4sr*Yq zep;w26^HU{TK($|@tO@AcQvtmMUrAExp~Q8V~)j75A#bmnWRl;M8vEZ=7cI18{+D^ zC_q;Mq^rXKo4YC~V(-Zgx!HOVHg`23?go7UP;NF_tCi4S^fp~OFBO4z5nwyRah-Z3 zsc^eujJ7{8M&&~L8)G(39>`5MprP-VE%8JSoNV$^4!lB2^n#m>>Pi^;<$S_D^b0Ay z570C4=d!s*-2;i7u>0#=3)h&}9x7`Y*@O - 学前教育数据测试 + 云南省学前教育数据 +
-

学前教育招生人数统计

-
+

云南省学前教育人数统计

+ +
+
+ + + +
+
+ +