Private
Public Access
1
0

some error checking in interactive plot

This commit is contained in:
Sander Roosendaal
2017-05-11 08:47:42 +02:00
parent ab138f29ef
commit 33e185912e
2 changed files with 17 additions and 7 deletions

View File

@@ -997,11 +997,20 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
if datadf.empty:
return ['','<p>No non-zero data in selection</p>','','']
datadf['x1'] = datadf.ix[:,xparam]
datadf['y1'] = datadf.ix[:,yparam1]
try:
datadf['x1'] = datadf.ix[:,xparam]
except KeyError:
datadf['x1'] = datadf['distance']
try:
datadf['y1'] = datadf.ix[:,yparam1]
except KeyError:
datadf['y1'] = datadf['pace']
if yparam2 != 'None':
datadf['y2'] = datadf.ix[:,yparam2]
try:
datadf['y2'] = datadf.ix[:,yparam2]
except KeyError:
datadf['y2'] = datadf['y1']
else:
datadf['y2'] = datadf['y1']