mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-11 22:16:56 +03:00
fix missing value data
This commit is contained in:
@@ -50,39 +50,19 @@
|
|||||||
|
|
||||||
/* Catch empty fields */
|
/* Catch empty fields */
|
||||||
if (value == "" || isNaN(value)) {
|
if (value == "" || isNaN(value)) {
|
||||||
if (traceValue.y.length > 0) {
|
value = NaN;
|
||||||
value = traceValue.y[traceValue.y.length-1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
value = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preValue == "" || isNaN(preValue)) {
|
if (preValue == "" || isNaN(preValue)) {
|
||||||
if (tracePreValue.y.length > 0) {
|
preValue = NaN;
|
||||||
preValue = tracePreValue.y[tracePreValue.y.length-1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
preValue = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeRate == "" || isNaN(changeRate)) {
|
if (changeRate == "" || isNaN(changeRate)) {
|
||||||
if (traceChangeRate.y.length > 0) {
|
changeRate = NaN;
|
||||||
changeRate = traceChangeRate.y[traceChangeRate.y.length-1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
changeRate = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeAbsolute == "" || isNaN(changeAbsolute)) {
|
if (changeAbsolute == "" || isNaN(changeAbsolute)) {
|
||||||
if (traceChangeAbsolute.y.length > 0) {
|
changeAbsolute = NaN;
|
||||||
changeAbsolute = traceChangeAbsolute.y[traceChangeAbsolute.y.length-1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
changeAbsolute = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
traceValue.y.push(value);
|
traceValue.y.push(value);
|
||||||
@@ -104,6 +84,8 @@
|
|||||||
var offsetValue = traceValue.y[0];
|
var offsetValue = traceValue.y[0];
|
||||||
var offsetPreValue = tracePreValue.y[0];
|
var offsetPreValue = tracePreValue.y[0];
|
||||||
|
|
||||||
|
traceValue.connectgaps = true;
|
||||||
|
|
||||||
if (showRrelativeValues) {
|
if (showRrelativeValues) {
|
||||||
traceValue.y.forEach(function(part, index, arr) {
|
traceValue.y.forEach(function(part, index, arr) {
|
||||||
arr[index] = arr[index] - offsetValue;
|
arr[index] = arr[index] - offsetValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user