Private
Public Access
1
0

first version actual/executed chart for plan

This commit is contained in:
Sander Roosendaal
2019-10-05 14:35:06 +02:00
parent 65db7ee6d8
commit c12a2c8fe3
6 changed files with 299 additions and 97 deletions

View File

@@ -232,6 +232,37 @@ def interactive_boxchart(datadf,fieldname,extratitle='',
return script,div
def interactive_planchart(data,startdate,enddate):
source = ColumnDataSource(data)
hv.extension('bokeh')
yaxmaximum = data['executed'].max()
if data['planned'].max() > yaxmaximum:
yaxmaximum = data['planned'].max()
yrange1 = Range1d(start=0,end=1.1*yaxmaximum)
tidy_df = data.melt(id_vars=['startdate'],value_vars=['planned','executed'])
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.plot_width=550
p.plot_height=350
p.y_range = yrange1
p.toolbar_location = 'above'
p.sizing_mode = 'scale_width'
script,div = components(p)
return script,div
def interactive_activitychart(workouts,startdate,enddate,stack='type'):
dates = []
@@ -352,7 +383,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
p.plot_width=550
p.plot_height=350
p.toolbar_location = None
p.toolbar_location = 'above'
p.sizing_mode = 'scale_width'
url = "http://rowsandall.com/rowers/workout/@duration/"
taptool = p.select(type=TapTool)