ver Dec27thv2
updated a task config updated documents fixed the options feature of evaluator updated with new properties of charts current load_charts should be ok, I think
This commit is contained in:
@@ -48,6 +48,13 @@ def load_sparklines(xlsx_file: str) -> Dict[str, str]:
|
||||
sparklines_dict[sparkline["x14:sparkline"]["xm:sqref"]] = sparkline["x14:sparkline"]["xm:f"]
|
||||
return sparklines_dict
|
||||
|
||||
# Available Chart Properties:
|
||||
# title: str
|
||||
# anchor: ["oneCell" | "twoCell" | "absolute", col0, row0, col1, row1]
|
||||
# width: number
|
||||
# height: number
|
||||
# type: "scatterChart" | "lineChart" | "barChart"
|
||||
# xtitle, ytitle, ztitle: str
|
||||
def load_charts(xlsx_file: str, **options) -> Dict[str, Any]:
|
||||
"""
|
||||
Args:
|
||||
@@ -100,6 +107,15 @@ def load_charts(xlsx_file: str, **options) -> Dict[str, Any]:
|
||||
info["width"] = ch.width
|
||||
if "height" in chart_props:
|
||||
info["height"] = ch.height
|
||||
if "type" in chart_props:
|
||||
info["type"] = ch.tagname
|
||||
|
||||
if "xtitle" in chart_props:
|
||||
info["xtitle"] = ch.x_axis.title.tx.rich.p[0].r[0].t
|
||||
if "ytitle" in chart_props:
|
||||
info["ytitle"] = ch.y_axis.title.tx.rich.p[0].r[0].t
|
||||
if "ztitle" in chart_props:
|
||||
info["ztitle"] = ch.z_axis.title.tx.rich.p[0].r[0].t
|
||||
chart_set[series] = info
|
||||
return chart_set
|
||||
|
||||
@@ -139,4 +155,4 @@ if __name__ == "__main__":
|
||||
|
||||
#df1 = pd.read_excel(path1)
|
||||
#print(df1)
|
||||
print(load_charts(path1, chart_props=["title", "width", "height"]))
|
||||
print(load_charts(path1, chart_props=["title", "xtitle", "ytitle", "type"]))
|
||||
|
||||
Reference in New Issue
Block a user