ver Dec29thv2

re-organized functions w.r.t. comparing xlsx with a golden one
This commit is contained in:
David Chang
2023-12-29 21:43:33 +08:00
parent e4fac09945
commit 6f225b2a02
6 changed files with 72 additions and 69 deletions

View File

@@ -56,10 +56,10 @@ def load_sparklines(xlsx_file: str) -> Dict[str, str]:
# type: "scatterChart" | "lineChart" | "barChart"
# direction: "bar" (hori) | "col" (vert)
# xtitle, ytitle, ztitle: str
def load_charts(xlsx_file: str, **options) -> Dict[str, Any]:
def load_charts(xlsx_file: Workbook, **options) -> Dict[str, Any]:
"""
Args:
xlsx_file (str): path to xlsx
xlsx_file (Workbook): concerned excel book
options (Dict[str, List[str]]): dict like {"chart_props": list of str}
giving the concerned chart properties
@@ -67,8 +67,8 @@ def load_charts(xlsx_file: str, **options) -> Dict[str, Any]:
Dict[str, Any]: information of charts
"""
workbook: Workbook = openpyxl.load_workbook(filename=xlsx_file)
worksheet: Worksheet = workbook.active
#workbook: Workbook = openpyxl.load_workbook(filename=xlsx_file)
worksheet: Worksheet = xlsx_file.active
charts: List[ChartBase] = worksheet._charts
chart_set: Dict[str, Any] = {}