mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
fixed csv charts
This commit is contained in:
parent
318094d758
commit
170ee5b9a5
@ -3,8 +3,8 @@
|
||||
export: {
|
||||
export_data: false, // or true
|
||||
labels_long: null,
|
||||
homeurl: "",
|
||||
},
|
||||
homeurl: ""
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
@ -71,12 +71,12 @@
|
||||
*/
|
||||
if (type === "csv") {
|
||||
result = {
|
||||
head: ["timestap", "date", "value", "label"],
|
||||
data: [],
|
||||
head: ["timestamp", "date", "value", "label"],
|
||||
data: []
|
||||
};
|
||||
|
||||
dataObject.data.forEach(function(item, index) {
|
||||
var timestap = item[0];
|
||||
var timestamp = item[0];
|
||||
|
||||
var d = new Date(item[0]);
|
||||
var monthNames = [
|
||||
@ -91,7 +91,7 @@
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec",
|
||||
"Dec"
|
||||
];
|
||||
|
||||
date_format =
|
||||
@ -119,7 +119,7 @@
|
||||
dataObject.label
|
||||
];
|
||||
clean_label = clean_label.replace(new RegExp(" ", "g"), " ");
|
||||
result.data.push([timestap, date, value, clean_label]);
|
||||
result.data.push([timestamp, date, value, clean_label]);
|
||||
});
|
||||
} else if (type === "json") {
|
||||
/* [
|
||||
@ -156,7 +156,7 @@
|
||||
result.push({
|
||||
date: date,
|
||||
value: value,
|
||||
label: dataObject.label,
|
||||
label: dataObject.label
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -177,7 +177,6 @@
|
||||
});
|
||||
graphData = elements;
|
||||
|
||||
|
||||
// Transform the object data into a string
|
||||
// cause PHP has limitations in the number
|
||||
// of POST params received.
|
||||
@ -290,7 +289,7 @@
|
||||
if (type === "csv") {
|
||||
result = {
|
||||
head: ["date", "value", "label"],
|
||||
data: [],
|
||||
data: []
|
||||
};
|
||||
|
||||
dataObject.data.forEach(function(item, index) {
|
||||
@ -341,7 +340,7 @@
|
||||
result.push({
|
||||
date: date,
|
||||
value: value,
|
||||
label: dataObject.label,
|
||||
label: dataObject.label
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -420,6 +419,6 @@
|
||||
init: init,
|
||||
options: options,
|
||||
name: "exportdata",
|
||||
version: "0.1",
|
||||
version: "0.1"
|
||||
});
|
||||
})(jQuery);
|
||||
|
Loading…
x
Reference in New Issue
Block a user