Private
Public Access
1
0

some small additions

This commit is contained in:
Sander Roosendaal
2019-11-17 14:49:34 +01:00
parent 30d4b894a1
commit cf9ea7d058
2 changed files with 20 additions and 8 deletions

View File

@@ -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 = """
<canvas id="myChart">
</canvas>
@@ -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]

View File

@@ -73,11 +73,11 @@
</li>
{% endif %}
<li class="grid_2">
<div style="height:100%" id="theplot" class="flexplot mapdiv">
<div id="theplot" class="flexplot mapdiv">
{{ mapdiv | safe}}
</div>
<div>
<div class="slidecontainer">
<input type="range" min="0" max="{{ maxtime }}" value="{{ analysis.delay }}"
id="myRange">
</div>