Typo again
This commit is contained in:
parent
cab9498f2b
commit
e5a1948f59
@ -29,14 +29,14 @@ def name_from_field(field: str) -> str :
|
||||
def main():
|
||||
stats_fn, web_render = parse_args()
|
||||
data = load_data(stats_fn)
|
||||
|
||||
|
||||
render(data, web_render)
|
||||
|
||||
|
||||
def load_data(stats_fn: str):
|
||||
with open(stats_fn) as stats_f:
|
||||
data = json.load(stats_f)
|
||||
|
||||
|
||||
data_dict = {name_from_field(field): [0]*len(data) for field in data[0]}
|
||||
print("Found", len(data), "points")
|
||||
|
||||
@ -55,7 +55,6 @@ def load_data(stats_fn: str):
|
||||
def render(data: dict, web_render:bool=False):
|
||||
bar_chart = pygal.StackedBar(height=400, legend_box_size=5, x_label_rotation=25)
|
||||
labels = [d.strftime("%B %d %H:%M") for d in data["date"]]
|
||||
print(labels)
|
||||
bar_chart.x_labels = labels
|
||||
for k in data:
|
||||
if k == "date":
|
||||
@ -63,7 +62,7 @@ def render(data: dict, web_render:bool=False):
|
||||
#if "db" in k or "database" in k or "mysql" in k or "mongo" in k or "postgre" in k:
|
||||
# continue
|
||||
bar_chart.add(k, data[k])
|
||||
|
||||
|
||||
if web_render:
|
||||
bar_chart.render_in_browser()
|
||||
else:
|
||||
|
@ -15,7 +15,7 @@ if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
|
||||
echo " - stats_file: path to stats file"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " - w: do rende1r using web browser"
|
||||
echo " - w: do render using web browser"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user