plan chart v1
This commit is contained in:
@@ -365,36 +365,6 @@ def interactive_planchart(data, startdate, enddate):
|
|||||||
script, div = get_chart("/plan", chart_data, debug=False)
|
script, div = get_chart("/plan", chart_data, debug=False)
|
||||||
return script, div
|
return script, div
|
||||||
|
|
||||||
hv.extension('bokeh')
|
|
||||||
|
|
||||||
yaxmaximum = data['executed'].max()
|
|
||||||
if data['planned'].max() > yaxmaximum: # pragma: no cover
|
|
||||||
yaxmaximum = data['planned'].max()
|
|
||||||
|
|
||||||
if yaxmaximum == 0: # pragma: no cover
|
|
||||||
yaxmaximum = 250
|
|
||||||
|
|
||||||
yrange1 = Range1d(start=0, end=1.1*yaxmaximum)
|
|
||||||
|
|
||||||
tidy_df = data.melt(id_vars=['startdate'], value_vars=[
|
|
||||||
'executed', 'planned'])
|
|
||||||
bars = hv.Bars(tidy_df, ['startdate', 'variable'], ['value'])
|
|
||||||
bars.opts(
|
|
||||||
opts.Bars(show_legend=True, tools=['tap', 'hover'], legend_position='bottom', show_frame=True))
|
|
||||||
|
|
||||||
p = hv.render(bars)
|
|
||||||
|
|
||||||
p.width = 550
|
|
||||||
p.height = 350
|
|
||||||
p.y_range = yrange1
|
|
||||||
p.toolbar_location = 'above'
|
|
||||||
#p.sizing_mode = 'stretch_both'
|
|
||||||
|
|
||||||
script, div = components(p)
|
|
||||||
|
|
||||||
return script, div
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def interactive_activitychart2(workouts, startdate, enddate, stack='type',
|
def interactive_activitychart2(workouts, startdate, enddate, stack='type',
|
||||||
yaxis='duration'):
|
yaxis='duration'):
|
||||||
|
|||||||
Reference in New Issue
Block a user