box chart working
This commit is contained in:
@@ -396,6 +396,18 @@ def interactive_boxchart(datadf, fieldname, extratitle='',
|
|||||||
if 'date' not in columns: # pragma: no cover
|
if 'date' not in columns: # pragma: no cover
|
||||||
return '', 'Not enough data'
|
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 = [
|
tooltips = [
|
||||||
('Value', '@'+fieldname),
|
('Value', '@'+fieldname),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user