Private
Public Access
1
0

box chart working

This commit is contained in:
2024-03-08 00:05:17 +01:00
parent 35efe7e265
commit bf2f5397b9
2 changed files with 13 additions and 1 deletions

View File

@@ -396,6 +396,18 @@ def interactive_boxchart(datadf, fieldname, extratitle='',
if 'date' not in columns: # pragma: no cover
return '', 'Not enough data'
datadf.date = datadf.date.apply(lambda x:x.strftime("%Y-%m-%d"))
datadf['value'] = datadf[fieldname]
data_dict = datadf.to_dict("records")
boxplot_data = {
"metric": metricsdicts[fieldname]["verbose_name"],
"data": data_dict
}
script, div = get_chart("/boxplot", boxplot_data)
return script, div
tooltips = [
('Value', '@'+fieldname),
]

View File

@@ -952,7 +952,7 @@ def boxplotdata(workouts, options):
savedata = options.get('savedata',False)
if savedata: # pragma: no cover
return datadf
return datadf
script, div = interactive_boxchart(datadf, plotfield,
extratitle=extratitle,