diff --git a/desktop_env/evaluators/metrics/table.py b/desktop_env/evaluators/metrics/table.py index b07e6e6..2366eed 100644 --- a/desktop_env/evaluators/metrics/table.py +++ b/desktop_env/evaluators/metrics/table.py @@ -130,4 +130,4 @@ if __name__ == '__main__': path1 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold.xlsx" path2 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold2.xlsx" - print(compare_with_charts(path1, path2, chart_props=["type"])) + print(compare_with_charts(path1, path2, chart_props=["type", "direction"])) diff --git a/desktop_env/evaluators/metrics/utils.py b/desktop_env/evaluators/metrics/utils.py index a466834..65db158 100644 --- a/desktop_env/evaluators/metrics/utils.py +++ b/desktop_env/evaluators/metrics/utils.py @@ -54,6 +54,7 @@ def load_sparklines(xlsx_file: str) -> Dict[str, str]: # width: number # height: number # type: "scatterChart" | "lineChart" | "barChart" +# direction: "bar" (hori) | "col" (vert) # xtitle, ytitle, ztitle: str def load_charts(xlsx_file: str, **options) -> Dict[str, Any]: """ @@ -109,6 +110,8 @@ def load_charts(xlsx_file: str, **options) -> Dict[str, Any]: info["height"] = ch.height if "type" in chart_props: info["type"] = ch.tagname + if "direction" in chart_props: + info["direction"] = ch.barDir if "xtitle" in chart_props: info["xtitle"] = ch.x_axis.title.tx.rich.p[0].r[0].t @@ -120,7 +123,7 @@ def load_charts(xlsx_file: str, **options) -> Dict[str, Any]: return chart_set if __name__ == "__main__": - path1 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold.xlsx" + path1 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold_line_scatter.xlsx" workbook1: Workbook = openpyxl.load_workbook(filename=path1) worksheet1: Worksheet = workbook1.active charts: List[ChartBase] = worksheet1._charts diff --git a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json index 548cd29..f5e9552 100644 --- a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json +++ b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json @@ -40,7 +40,8 @@ }, "options": { "chart_props": [ - "type" + "type", + "direction" ] } }