diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 951c04f8..5e11a871 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1,4 +1,3 @@ - from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage from rowingdata import rower as rrower from rowingdata import main as rmain @@ -1822,11 +1821,14 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm', else: rowdata2.sort_values(by='time',ascending=True,inplace=True) - x1 = rowdata1.ix[:,xparam] - x2 = rowdata2.ix[:,xparam] + try: + x1 = rowdata1.ix[:,xparam] + x2 = rowdata2.ix[:,xparam] - y1 = rowdata1.ix[:,yparam] - y2 = rowdata2.ix[:,yparam] + y1 = rowdata1.ix[:,yparam] + y2 = rowdata2.ix[:,yparam] + except KeyError: + return "","No valid Data Available" x_axis_type = 'linear' y_axis_type = 'linear' @@ -1949,7 +1951,7 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm', plot.title.text = row1.name+' vs '+row2.name plot.title.text_font_size=value("1.2em") plot.xaxis.axis_label = axlabels[xparam] - + plot.yaxis.axis_label = axlabels[yparam] if xparam == 'time': plot.xaxis[0].formatter = DatetimeTickFormatter( diff --git a/rowers/templates/comparisonchart2.html b/rowers/templates/comparisonchart2.html index c6f664a0..a07b41bd 100644 --- a/rowers/templates/comparisonchart2.html +++ b/rowers/templates/comparisonchart2.html @@ -6,144 +6,134 @@ {% block content %} - - + + - {{ interactiveplot |safe }} +{{ interactiveplot |safe }} - - + +