Commit 0a1c18a7 authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_base: Sort KPI graph data chronologically

Improve support for out-of-order KPI data arrays
parent aa8a86c6
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
vInitialEPSBEstabSR_hi = [], vInitialEPSBEstabSR_hi = [],
vAddedEPSBEstabSR_lo = [], vAddedEPSBEstabSR_lo = [],
vAddedEPSBEstabSR_hi = []; vAddedEPSBEstabSR_hi = [];
graph_data.sort(function (a, b) {
return (a[0] - b[0]);
});
for (i = 0; i < graph_data.length; i += 1) { for (i = 0; i < graph_data.length; i += 1) {
date.push(new Date(graph_data[i][0] * 1000)); date.push(new Date(graph_data[i][0] * 1000));
vInitialEPSBEstabSR_lo.push(graph_data[i][1]); vInitialEPSBEstabSR_lo.push(graph_data[i][1]);
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1018.61980.60679.28364</string> </value> <value> <string>1019.54468.57368.35892</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1724920139.77</float> <float>1728632990.63</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -118,6 +118,9 @@ ...@@ -118,6 +118,9 @@
raw_ul_hi, raw_ul_hi,
download_link = gadget.element.querySelector('.graph-download-link'), download_link = gadget.element.querySelector('.graph-download-link'),
upload_link = gadget.element.querySelector('.graph-upload-link'); upload_link = gadget.element.querySelector('.graph-upload-link');
graph_data.sort(function (a, b) {
return (a[0] - b[0]);
});
for (i = 0; i < graph_data.length; i += 1) { for (i = 0; i < graph_data.length; i += 1) {
if (date.indexOf(graph_data[i][0]) == -1) { if (date.indexOf(graph_data[i][0]) == -1) {
date.push(graph_data[i][0]); date.push(graph_data[i][0]);
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1018.60794.3206.50773</string> </value> <value> <string>1019.54468.57368.35892</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1724849600.03</float> <float>1728633034.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment