responsive frm
This commit is contained in:
@@ -1680,6 +1680,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
||||
metricchoice='trimp',doform=False,dofatigue=False):
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
TOOLS2 = 'box_zoom,hover'
|
||||
|
||||
|
||||
fatigues = []
|
||||
@@ -1777,18 +1778,18 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
||||
fitlabel = 'PTE (fitness)'
|
||||
fatiguelabel = 'NTE (fatigue)'
|
||||
formlabel = 'Performance'
|
||||
rightaxlabel = 'NTE'
|
||||
if doform:
|
||||
yaxlabel = 'PTE/Performance'
|
||||
rightaxlabel = 'Performance'
|
||||
if dofatigue:
|
||||
yaxlabel = 'PTE/NTE'
|
||||
else:
|
||||
yaxlabel = 'PTE'
|
||||
else:
|
||||
fitlabel = 'Fitness'
|
||||
fatiguelabel = 'Fatigue'
|
||||
formlabel = 'Freshness'
|
||||
rightaxlabel = 'Fatigue'
|
||||
if doform:
|
||||
yaxlabel = 'Fitness/Freshness'
|
||||
rightaxlabel = 'Freshness'
|
||||
if dofatigue:
|
||||
yaxlabel = 'Fitness/Fatigue'
|
||||
else:
|
||||
yaxlabel = 'Fitness'
|
||||
|
||||
@@ -1829,13 +1830,6 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
||||
|
||||
plot.legend.location = "top_left"
|
||||
|
||||
#plot.xaxis.formatter = DatetimeTickFormatter(
|
||||
# days=["%d %B %Y"],
|
||||
# months=["%d %B %Y"],
|
||||
# years=["%d %B %Y"],
|
||||
# )
|
||||
|
||||
#plot.xaxis.major_label_orientation = pi/4
|
||||
plot.sizing_mode = 'scale_both'
|
||||
|
||||
#plot.y_range = Range1d(0,1.5*max(df['testpower']))
|
||||
@@ -1854,19 +1848,26 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
||||
|
||||
hover = plot.select(dict(type=HoverTool))
|
||||
|
||||
linked_crosshair = CrosshairTool(dimensions='height')
|
||||
|
||||
hover.tooltips = OrderedDict([
|
||||
#(legend_label,'@testpower'),
|
||||
('Date','@fdate'),
|
||||
(fitlabel,'@fitness'),
|
||||
(fatiguelabel,'@fatigue'),
|
||||
(formlabel,'@form')
|
||||
(formlabel,'@form'),
|
||||
('Impulse','@impulse')
|
||||
])
|
||||
|
||||
plot2 = Figure(tools=TOOLS,x_axis_type='datetime',
|
||||
|
||||
|
||||
plot2 = Figure(tools=TOOLS2,x_axis_type='datetime',
|
||||
plot_width=900,plot_height=150,
|
||||
toolbar_location=None,
|
||||
toolbar_sticky=False)
|
||||
|
||||
|
||||
|
||||
plot2.x_range = xrange
|
||||
plot2.y_range = Range1d(0,df['impulse'].max())
|
||||
|
||||
@@ -1876,6 +1877,9 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
||||
plot2.yaxis.axis_label = 'Impulse'
|
||||
plot2.xaxis.axis_label = 'Date'
|
||||
|
||||
plot.add_tools(linked_crosshair)
|
||||
plot2.add_tools(linked_crosshair)
|
||||
|
||||
layout = layoutcolumn([plot,plot2])
|
||||
layout.sizing_mode = 'stretch_both'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user