Private
Public Access
1
0

Merge branch 'feature/trendline' into develop

This commit is contained in:
Sander Roosendaal
2022-09-14 19:02:19 +02:00
7 changed files with 69 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ defaultoptions = {
'waterboattype': mytypes.waterboattype,
'function': 'boxplot',
'ranking': False,
'trendline': False,
}
@@ -307,6 +308,7 @@ def trendflexdata(workouts, options, userid=0):
ids = options['ids']
workstrokesonly = not includereststrokes
fieldlist, fielddict = dataprep.getstatsfields()
fieldlist = [xparam, yparam, groupby,
'workoutid', 'spm', 'driveenergy',
@@ -477,6 +479,7 @@ def flexalldata(workouts, options):
xparam = options['xaxis']
yparam1 = options['yaxis1']
yparam2 = options['yaxis2']
trendline = options['trendline']
promember = True
workstrokesonly = not includereststrokes
@@ -486,6 +489,7 @@ def flexalldata(workouts, options):
yparam2=yparam2,
promember=promember,
workstrokesonly=workstrokesonly,
trendline=trendline,
)
script = res[0]
div = res[1]

View File

@@ -3760,6 +3760,11 @@ def workout_flexchart3_view(request, *args, **kwargs):
else:
plottype = 'line'
if 'trendline' in kwargs: # pragma: no cover
trendline = kwargs['trendline']
else:
trendline = False
if 'workstrokesonly' in kwargs: # pragma: no cover
workstrokesonly = kwargs['workstrokesonly']
else:
@@ -3790,6 +3795,7 @@ def workout_flexchart3_view(request, *args, **kwargs):
cd = flexoptionsform.cleaned_data
includereststrokes = cd['includereststrokes']
plottype = cd['plottype']
trendline = cd['trendline']
workstrokesonly = not includereststrokes
@@ -3832,7 +3838,9 @@ def workout_flexchart3_view(request, *args, **kwargs):
xparam=xparam, yparam1=yparam1,
yparam2=yparam2,
promember=promember, plottype=plottype,
workstrokesonly=workstrokesonly, mode=row.workouttype
workstrokesonly=workstrokesonly,
trendline=trendline,
mode=row.workouttype
)
axchoicesbasic = {ax[0]: ax[1] for ax in axes if ax[4] == 'basic'}
@@ -3876,7 +3884,8 @@ def workout_flexchart3_view(request, *args, **kwargs):
initial = {
'includereststrokes': not workstrokesonly,
'plottype': plottype
'plottype': plottype,
'trendline': trendline,
}
flexoptionsform = FlexOptionsForm(initial=initial)