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: {
|
||||||
export_data: false, // or true
|
export_data: false, // or true
|
||||||
labels_long: null,
|
labels_long: null,
|
||||||
homeurl: "",
|
homeurl: ""
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function init(plot) {
|
function init(plot) {
|
||||||
@ -71,12 +71,12 @@
|
|||||||
*/
|
*/
|
||||||
if (type === "csv") {
|
if (type === "csv") {
|
||||||
result = {
|
result = {
|
||||||
head: ["timestap", "date", "value", "label"],
|
head: ["timestamp", "date", "value", "label"],
|
||||||
data: [],
|
data: []
|
||||||
};
|
};
|
||||||
|
|
||||||
dataObject.data.forEach(function(item, index) {
|
dataObject.data.forEach(function(item, index) {
|
||||||
var timestap = item[0];
|
var timestamp = item[0];
|
||||||
|
|
||||||
var d = new Date(item[0]);
|
var d = new Date(item[0]);
|
||||||
var monthNames = [
|
var monthNames = [
|
||||||
@ -91,7 +91,7 @@
|
|||||||
"Sep",
|
"Sep",
|
||||||
"Oct",
|
"Oct",
|
||||||
"Nov",
|
"Nov",
|
||||||
"Dec",
|
"Dec"
|
||||||
];
|
];
|
||||||
|
|
||||||
date_format =
|
date_format =
|
||||||
@ -119,7 +119,7 @@
|
|||||||
dataObject.label
|
dataObject.label
|
||||||
];
|
];
|
||||||
clean_label = clean_label.replace(new RegExp(" ", "g"), " ");
|
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") {
|
} else if (type === "json") {
|
||||||
/* [
|
/* [
|
||||||
@ -156,7 +156,7 @@
|
|||||||
result.push({
|
result.push({
|
||||||
date: date,
|
date: date,
|
||||||
value: value,
|
value: value,
|
||||||
label: dataObject.label,
|
label: dataObject.label
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -177,7 +177,6 @@
|
|||||||
});
|
});
|
||||||
graphData = elements;
|
graphData = elements;
|
||||||
|
|
||||||
|
|
||||||
// Transform the object data into a string
|
// Transform the object data into a string
|
||||||
// cause PHP has limitations in the number
|
// cause PHP has limitations in the number
|
||||||
// of POST params received.
|
// of POST params received.
|
||||||
@ -290,7 +289,7 @@
|
|||||||
if (type === "csv") {
|
if (type === "csv") {
|
||||||
result = {
|
result = {
|
||||||
head: ["date", "value", "label"],
|
head: ["date", "value", "label"],
|
||||||
data: [],
|
data: []
|
||||||
};
|
};
|
||||||
|
|
||||||
dataObject.data.forEach(function(item, index) {
|
dataObject.data.forEach(function(item, index) {
|
||||||
@ -341,7 +340,7 @@
|
|||||||
result.push({
|
result.push({
|
||||||
date: date,
|
date: date,
|
||||||
value: value,
|
value: value,
|
||||||
label: dataObject.label,
|
label: dataObject.label
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -420,6 +419,6 @@
|
|||||||
init: init,
|
init: init,
|
||||||
options: options,
|
options: options,
|
||||||
name: "exportdata",
|
name: "exportdata",
|
||||||
version: "0.1",
|
version: "0.1"
|
||||||
});
|
});
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user