This commit is contained in:
2025-09-11 14:07:47 +08:00
parent 743cbd9492
commit 40a7a8fb7a
3 changed files with 9 additions and 17 deletions

View File

@@ -93,7 +93,7 @@ class RuYuanZaiYuanModel:
"borderWidth": 1
},
"legend": {
"data": ["城区", "镇区", "乡村", "总入园数", "2022年基数(万人)"],
"data": ["城区", "镇区", "乡村", "总入园数", "2022年基数"],
"top": 0,
"textStyle": {"color": "#fff"},
"icon": "roundRect",
@@ -104,7 +104,7 @@ class RuYuanZaiYuanModel:
{
"type": "category",
"data": years,
"axisPointer": {type: "shadow"},
"axisPointer": {"type": "shadow"},
"axisLine": {"lineStyle": {"color": "#fff"}},
"axisLabel": {"color": "#fff"},
"nameTextStyle": {"color": "#fff"}
@@ -113,9 +113,7 @@ class RuYuanZaiYuanModel:
"yAxis": [
{
"type": "value",
"min": 0,
"max": 25,
"interval": 5,
"axisLabel": {
"formatter": "{value}"
, "color": "#fff"
@@ -123,9 +121,7 @@ class RuYuanZaiYuanModel:
},
{
"type": "value",
"min": 0,
"max": 25,
"interval": 5,
"axisLabel": {"formatter": "{value}", "color": "#fff"},
},
@@ -134,7 +130,6 @@ class RuYuanZaiYuanModel:
{
"name": "城区",
"type": "bar",
"tooltip": "{valueFormatter: (v) = > v 万人}",
"data": urban_data,
"itemStyle": {
"borderRadius": [6, 6, 0, 0],
@@ -144,7 +139,6 @@ class RuYuanZaiYuanModel:
"name": "镇区",
"type": "bar",
"data": town_data,
"tooltip": "{valueFormatter: (v) = > v 万人}",
"itemStyle": {
"borderRadius": [6, 6, 0, 0],
},
@@ -153,7 +147,6 @@ class RuYuanZaiYuanModel:
"name": "乡村",
"type": "bar",
"data": rural_data,
"tooltip": "{valueFormatter: (v) = > v 万人}",
"itemStyle": {
"borderRadius": [6, 6, 0, 0]
},
@@ -162,17 +155,14 @@ class RuYuanZaiYuanModel:
"name": "总入园数",
"type": "line",
"yAxisIndex": 1,
"data": total_enroll,
"tooltip": "{valueFormatter: (v) = > v 万人}",
"data": total_enroll
},
# 添加2022年基数的粉色折线
{
"name": "2022年基数(万人)",
"name": "2022年基数",
"type": "line",
"yAxisIndex": 1,
"data": base_2022_line,
"lineStyle": {"color": "#ff9e9e", "width": 2, "type": "solid"},
"tooltip": "{valueFormatter: (v) = > v 万人}",
"data": base_2022_line
}
]
}

View File

@@ -60,6 +60,8 @@ $(function () {
seriesItem.tooltip = { valueFormatter: (v) => v + " 万人" };
});
myChart.setOption(option);
window.addEventListener("resize", function () {
myChart.resize();