'commit'
This commit is contained in:
@@ -48,7 +48,9 @@ class RuYuanZaiYuanModel:
|
||||
urban_data.append(enroll_data.get("urban", 0) / 10000) # 转换为万人
|
||||
town_data.append(enroll_data.get("town", 0) / 10000) # 转换为万人
|
||||
rural_data.append(enroll_data.get("rural", 0) / 10000) # 转换为万人
|
||||
total_enroll.append(enroll_data.get("total", 0) / 10000) # 转换为万人
|
||||
# 计算总和作为总入园数,而非使用文件中的total字段
|
||||
calculated_total = enroll_data.get("urban", 0) + enroll_data.get("town", 0) + enroll_data.get("rural", 0)
|
||||
total_enroll.append(calculated_total / 10000) # 转换为万人
|
||||
|
||||
# 构建ECharts配置
|
||||
option = {
|
||||
@@ -103,7 +105,22 @@ class RuYuanZaiYuanModel:
|
||||
"type": "value",
|
||||
"name": "总入园数",
|
||||
"min": 0,
|
||||
"max": 40,
|
||||
"max": "auto",
|
||||
"interval": "auto", # 自动计算间隔
|
||||
"position": "right", # 显示在右侧
|
||||
"axisLabel": {
|
||||
"formatter": "{value} 万人", # 确保数值格式正确
|
||||
"color": "#ee6666"
|
||||
},
|
||||
"axisLine": {"show": True, "lineStyle": {"color": "#ee6666"}},
|
||||
"axisTick": {"show": True},
|
||||
"color": "#333"
|
||||
},
|
||||
{
|
||||
"type": "value",
|
||||
"name": "总入园数",
|
||||
"min": 0,
|
||||
"max": "auto", # 修改为自动适应数据最大值
|
||||
"interval": 8,
|
||||
"axisLabel": {
|
||||
"formatter": "{value} 万人",
|
||||
|
Reference in New Issue
Block a user