diff --git a/Model/RuYuanZaiYuanCountModel.py b/Model/RuYuanZaiYuanCountModel.py index 722fe11..ed45136 100644 --- a/Model/RuYuanZaiYuanCountModel.py +++ b/Model/RuYuanZaiYuanCountModel.py @@ -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 } ] } diff --git a/Model/__pycache__/RuYuanZaiYuanCountModel.cpython-312.pyc b/Model/__pycache__/RuYuanZaiYuanCountModel.cpython-312.pyc index e1643de..65367fd 100644 Binary files a/Model/__pycache__/RuYuanZaiYuanCountModel.cpython-312.pyc and b/Model/__pycache__/RuYuanZaiYuanCountModel.cpython-312.pyc differ diff --git a/static/js/index.js b/static/js/index.js index ebfb844..67300c0 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -60,6 +60,8 @@ $(function () { seriesItem.tooltip = { valueFormatter: (v) => v + " 万人" }; }); + + myChart.setOption(option); window.addEventListener("resize", function () { myChart.resize();