Sort exercise collection items by position in statistics view

This commit is contained in:
Maximilian Grundke
2018-07-20 10:36:10 +02:00
parent 574116cb1d
commit d80e3ecd3b
2 changed files with 9 additions and 8 deletions

View File

@@ -52,11 +52,11 @@ $(function() {
"translate(" + margin.left + "," + margin.top + ")");
// Get the data
data = Object.keys(data).map(function (key, index) {
data = Object.keys(data).map(function (key) {
return {
index: index,
exercise_id: parseInt(key),
working_time: parseFloat(data[key])
index: parseInt(key),
exercise_id: parseInt(data[key]['exercise_id']),
working_time: parseFloat(data[key]['working_time'])
};
});