Add color support for charts
This commit is contained in:
parent
f0653f972f
commit
44ee039ca6
3 changed files with 41 additions and 17 deletions
|
@ -108,14 +108,17 @@ def _generate_interval(interval: str, domain: Optional[str] = None) -> None:
|
|||
data = [dict(zip(headers, row)) for row in rows]
|
||||
json_path = out_dir / f"{name}.json"
|
||||
_save_json(json_path, data)
|
||||
report_list.append(
|
||||
{
|
||||
"name": name,
|
||||
"label": definition.get("label", name.title()),
|
||||
"chart": definition.get("chart", "line"),
|
||||
"json": f"{name}.json",
|
||||
}
|
||||
)
|
||||
entry = {
|
||||
"name": name,
|
||||
"label": definition.get("label", name.title()),
|
||||
"chart": definition.get("chart", "line"),
|
||||
"json": f"{name}.json",
|
||||
}
|
||||
if "color" in definition:
|
||||
entry["color"] = definition["color"]
|
||||
if "colors" in definition:
|
||||
entry["colors"] = definition["colors"]
|
||||
report_list.append(entry)
|
||||
|
||||
_save_json(out_dir / "reports.json", report_list)
|
||||
_render_html(interval, report_list, out_dir / "index.html")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue