diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index b8cd6aea..5115779e 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -2971,6 +2971,20 @@ def interactive_chart_video(id=0): except KeyError: datadf['pace'] = 0 + time = datadf['time'] + + data = zip(time.tolist(),spm.tolist()) + + data2 = [] + + for time,spm in data: + data2.append( + { + 'x':time/1000., + 'y':spm, + } + ) + div = """ @@ -2978,19 +2992,17 @@ def interactive_chart_video(id=0): script = """ var ctx = document.getElementById("myChart").getContext('2d'); - var data = { - x: [1,2,3,4], - y: [1,4,9,16] - } + var data = %s var myChart = new Chart(ctx, { - type: 'line', + type: 'scatter', + label: 'pace', data: { datasets: [{ data: data, }] }, }); - """ + """ % data2 return [script,div] diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html index a4ec93b3..7a276676 100644 --- a/rowers/templates/embedded_video.html +++ b/rowers/templates/embedded_video.html @@ -73,11 +73,11 @@ {% endif %}
  • -
    +
    {{ mapdiv | safe}}
    -
    +