Merge branch 'hotfix/v3.67'
This commit is contained in:
@@ -2461,6 +2461,10 @@ def interactive_bar_chart(id=0,promember=0):
|
||||
def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
promember=0,
|
||||
labeldict=None):
|
||||
|
||||
message = ''
|
||||
errormessage = ''
|
||||
|
||||
columns = [xparam,yparam,
|
||||
'ftime','distance','fpace',
|
||||
'power','hr','spm',
|
||||
@@ -2483,7 +2487,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
|
||||
# check if dataframe not empty
|
||||
if datadf.empty:
|
||||
return ['','<p>No non-zero data in selection</p>','','']
|
||||
return ['','<p>No non-zero data in selection</p>','','No non-zero data in selection']
|
||||
|
||||
if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist':
|
||||
xaxmax = yaxmaxima[xparam]
|
||||
@@ -2555,7 +2559,11 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
for id,color in itertools.izip(ids,colors):
|
||||
group = datadf[datadf['workoutid']==int(id)].copy()
|
||||
group.sort_values(by='time',ascending=True,inplace=True)
|
||||
group['x'] = group[xparam]
|
||||
try:
|
||||
group['x'] = group[xparam]
|
||||
except KeyError:
|
||||
group['x'] = group['time']
|
||||
errormessage = xparam+' has no values. Plot invalid'
|
||||
try:
|
||||
group['y'] = group[yparam]
|
||||
except KeyError:
|
||||
@@ -2635,7 +2643,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
|
||||
|
||||
|
||||
return [script,div]
|
||||
return [script,div,message,errormessage]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -522,7 +522,8 @@ class StrokeData(models.Model):
|
||||
peakforce = models.FloatField(null=True,verbose_name='Peak Force')
|
||||
forceratio = models.FloatField(null=True,verbose_name='Average/Peak Force Ratio')
|
||||
distance = models.FloatField(null=True,verbose_name='Distance')
|
||||
drivespeed = models.FloatField(null=True,verbose_name='Drive Speed')
|
||||
drivespeed = models.FloatField(null=True,verbose_name='Drive Speed',
|
||||
default=0)
|
||||
hr_ut2 = models.IntegerField(null=True)
|
||||
hr_ut1 = models.IntegerField(null=True)
|
||||
hr_at = models.IntegerField(null=True)
|
||||
|
||||
@@ -3464,6 +3464,9 @@ def multi_compare_view(request):
|
||||
labeldict=labeldict)
|
||||
script = res[0]
|
||||
div = res[1]
|
||||
errormessage = res[3]
|
||||
if errormessage != '':
|
||||
messages.error(request,errormessage)
|
||||
|
||||
return render(request,'multicompare.html',
|
||||
{'interactiveplot':script,
|
||||
|
||||
Reference in New Issue
Block a user