diff --git a/AI/Text2Sql/Util/EchartsUtil.py b/AI/Text2Sql/Util/EchartsUtil.py index ce53f788..a5b00d01 100644 --- a/AI/Text2Sql/Util/EchartsUtil.py +++ b/AI/Text2Sql/Util/EchartsUtil.py @@ -1,4 +1,4 @@ -from pyecharts.charts import Bar, Pie +from pyecharts.charts import Bar, Pie, Page from pyecharts import options as opts from pyecharts.commons.utils import JsCode import os @@ -99,14 +99,12 @@ def generate_chart( # 确保目标目录存在 os.makedirs(os.path.dirname(output_file), exist_ok=True) - # 保存为 HTML 文件 - # 保存为 HTML 文件,并替换默认标题 - chart.render( - path=output_file, - #template_name="simple_chart.html", # 使用自定义模板 - title="长春云校数据统计" # 替换默认标题 - ) - print(f"图表已保存为 {output_file}") + # 创建 Page 实例,并指定标题 + page = Page(page_title="长春云校数据统计分析系统") + # 将两个图表添加到 Page 实例中 + page.add(chart) + # 将 Page 实例保存为 HTML 文件 + page.render(output_file) # 检查文件是否存在 if os.path.exists(output_file): diff --git a/AI/Text2Sql/Util/__pycache__/EchartsUtil.cpython-310.pyc b/AI/Text2Sql/Util/__pycache__/EchartsUtil.cpython-310.pyc index 413a645d..b7b4134e 100644 Binary files a/AI/Text2Sql/Util/__pycache__/EchartsUtil.cpython-310.pyc and b/AI/Text2Sql/Util/__pycache__/EchartsUtil.cpython-310.pyc differ diff --git a/AI/Text2Sql/static/html/08c9f80a-9e66-4754-aaf8-38f6ac7e204a.html b/AI/Text2Sql/static/html/08c9f80a-9e66-4754-aaf8-38f6ac7e204a.html deleted file mode 100644 index ae3a3723..00000000 --- a/AI/Text2Sql/static/html/08c9f80a-9e66-4754-aaf8-38f6ac7e204a.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - Awesome-pyecharts - - - - - -
- - - diff --git a/AI/Text2Sql/static/html/4e920022-a683-4e0d-a0fd-f91b6bcfe990.html b/AI/Text2Sql/static/html/4e920022-a683-4e0d-a0fd-f91b6bcfe990.html deleted file mode 100644 index 43cdb44f..00000000 --- a/AI/Text2Sql/static/html/4e920022-a683-4e0d-a0fd-f91b6bcfe990.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - Awesome-pyecharts - - - - - -
- - - diff --git a/AI/Text2Sql/static/html/e622f3a9-b804-48a6-bf2f-e3a3ee8c9091.html b/AI/Text2Sql/static/html/7d116cf0-4169-4a26-9e6d-9d0f640c05ff.html similarity index 93% rename from AI/Text2Sql/static/html/e622f3a9-b804-48a6-bf2f-e3a3ee8c9091.html rename to AI/Text2Sql/static/html/7d116cf0-4169-4a26-9e6d-9d0f640c05ff.html index 5b4487bb..943ac108 100644 --- a/AI/Text2Sql/static/html/e622f3a9-b804-48a6-bf2f-e3a3ee8c9091.html +++ b/AI/Text2Sql/static/html/7d116cf0-4169-4a26-9e6d-9d0f640c05ff.html @@ -2,17 +2,19 @@ - Awesome-pyecharts + 长春云校数据统计分析系统 -
+ +
+
+
+ diff --git a/AI/Text2Sql/static/html/c3d78daa-c1a1-435c-ac07-fdbe8afea85f.html b/AI/Text2Sql/static/html/c3d78daa-c1a1-435c-ac07-fdbe8afea85f.html deleted file mode 100644 index b67483be..00000000 --- a/AI/Text2Sql/static/html/c3d78daa-c1a1-435c-ac07-fdbe8afea85f.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - Awesome-pyecharts - - - - - -
- - - diff --git a/AI/Text2Sql/static/html/c6c40bb0-d6de-42aa-821a-01f834e6855c.html b/AI/Text2Sql/static/html/c6c40bb0-d6de-42aa-821a-01f834e6855c.html deleted file mode 100644 index 993bcbfa..00000000 --- a/AI/Text2Sql/static/html/c6c40bb0-d6de-42aa-821a-01f834e6855c.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - Awesome-pyecharts - - - - - -
- - - diff --git a/AI/Text2Sql/static/xlsx/e171d399-25f8-439f-95d5-75470c80496c.xlsx b/AI/Text2Sql/static/xlsx/e171d399-25f8-439f-95d5-75470c80496c.xlsx new file mode 100644 index 00000000..a53a996a Binary files /dev/null and b/AI/Text2Sql/static/xlsx/e171d399-25f8-439f-95d5-75470c80496c.xlsx differ