diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 5863e7b0..c59b4124 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1584,30 +1584,31 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm', - axlabels = { - 'time': 'Time', - 'distance': 'Distance (m)', - 'hr': 'Heart Rate (bpm)', - 'spm': 'Stroke Rate (spm)', - 'pace': 'Pace (/500m)', - 'power': 'Power (Watt)', - 'averageforce': 'Average Drive Force (lbs)', - 'drivelength': 'Drive Length (m)', - 'peakforce': 'Peak Drive Force (lbs)', - 'forceratio': 'Average/Peak Drive Force Ratio', - 'driveenergy': 'Work per Stroke (J)', - 'drivespeed': 'Drive Speed (m/s)', - } + columns = [xparam,yparam, + 'ftime','distance','fpace', + 'power','hr','spm', + 'time','pace','workoutstate'] # check if valid ID exists (workout exists) - rowdata1,row1 = dataprep.getrowdata_db(id=id1) - rowdata2,row2 = dataprep.getrowdata_db(id=id2) + #rowdata1,row1 = dataprep.getrowdata_db(id=id1) + #rowdata2,row2 = dataprep.getrowdata_db(id=id2) + + rowdata1 = dataprep.getsmallrowdata_db(columns,ids=[id1]) + rowdata2 = dataprep.getsmallrowdata_db(columns,ids=[id2]) + row1 = Workout.objects.get(id=id1) + row2 = Workout.objects.get(id=id2) + + if rowdata1.empty: return "","CSV Data File Not Found" + else: + rowdata1.sort_values(by='time',ascending=True,inplace=True) if rowdata2.empty: return "","CSV Data File Not Found" + else: + rowdata2.sort_values(by='time',ascending=True,inplace=True) x1 = rowdata1.ix[:,xparam] x2 = rowdata2.ix[:,xparam]