Make sure data are in order before displaying them

If we don't do this, the plotting library draws "backwards" lines which
looks ugly.

Closes #16
This commit is contained in:
Chris Wong 2015-08-08 13:58:49 +12:00
parent da6143339e
commit 3db6cacf80

View file

@ -158,6 +158,9 @@ $(document).ready(function () {
data[i].push([time, series[i].fn(stats, time, data[i].push([time, series[i].fn(stats, time,
prev_stats, prev_time)]); prev_stats, prev_time)]);
// the data may arrive out-of-order, so sort by time stamp first
data[i].sort(function (a, b) { return a[0] - b[0]; });
} }
// zip legends with data // zip legends with data