some small additions
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user