individual curves
This commit is contained in:
@@ -4071,7 +4071,10 @@ def interactive_streamchart(id=0, promember=0):
|
||||
return [script, div]
|
||||
|
||||
def instroke_interactive_chart(df,metric, workout, spm_min, spm_max,
|
||||
activeminutesmin, activeminutesmax):
|
||||
activeminutesmin, activeminutesmax,
|
||||
individual_curves):
|
||||
|
||||
|
||||
df_pos = (df+abs(df))/2.
|
||||
df_min = -(-df+abs(-df))/2.
|
||||
|
||||
@@ -4173,11 +4176,20 @@ def instroke_interactive_chart(df,metric, workout, spm_min, spm_max,
|
||||
plot.add_layout(label)
|
||||
plot.add_layout(label2)
|
||||
|
||||
plot.varea('x', y1='high', y2='low',source=source,fill_color="lightgray",alpha=0.5)
|
||||
if individual_curves:
|
||||
for index,row in df.iterrows():
|
||||
plot.line(xvals,row,color='lightgray',line_width=1)
|
||||
else:
|
||||
plot.varea('x', y1='high', y2='low',source=source,fill_color="lightgray",alpha=0.5)
|
||||
|
||||
plot.line('x','median',source=source,legend_label='median',color="black",
|
||||
line_width=3)
|
||||
|
||||
medrange = mean_vals.max()-mean_vals.min()
|
||||
yrange = Range1d(start=mean_vals.min()-0.2*medrange,
|
||||
end=mean_vals.max()+0.2*medrange,)
|
||||
plot.y_range = yrange
|
||||
|
||||
plot.add_tools(HoverTool(tooltips=TIPS))
|
||||
|
||||
script, div = components(plot)
|
||||
|
||||
Reference in New Issue
Block a user