mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
restored deleted part of a failed merge-conflict
This commit is contained in:
parent
37557da8a2
commit
6f4bfeb4ef
1 changed files with 42 additions and 0 deletions
|
@ -6,6 +6,48 @@ $(function() {
|
|||
var curr_max = 0;
|
||||
|
||||
function getData() {
|
||||
if (data.length > 0){
|
||||
var data_old = data[0];
|
||||
data = data.slice(1);
|
||||
curr_max = curr_max == data_old ? Math.max.apply(null, data) : curr_max;
|
||||
}
|
||||
|
||||
while (data.length < totalPoints) {
|
||||
var y = (typeof window.paste_num_tabvar !== "undefined") ? parseInt(window.paste_num_tabvar) : 0;
|
||||
curr_max = y > curr_max ? y : curr_max;
|
||||
data.push(y);
|
||||
}
|
||||
// Zip the generated y values with the x values
|
||||
var res = [];
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
res.push([i, data[i]])
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
var updateInterval = 1000;
|
||||
var options = {
|
||||
series: { shadowSize: 1 },
|
||||
lines: { fill: true, fillColor: { colors: [ { opacity: 1 }, { opacity: 0.1 } ] }},
|
||||
yaxis: { min: 0, max: 40 },
|
||||
colors: ["#a971ff"],
|
||||
grid: {
|
||||
tickColor: "#dddddd",
|
||||
borderWidth: 0
|
||||
},
|
||||
};
|
||||
var plot = $.plot("#realtimechart", [ getData() ], options);
|
||||
|
||||
function update() {
|
||||
plot.setData([getData()]);
|
||||
plot.getOptions().yaxes[0].max = curr_max;
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
setTimeout(update, updateInterval);
|
||||
}
|
||||
update();
|
||||
});
|
||||
|
||||
function initfunc( csvay, scroot) {
|
||||
window.csv = csvay;
|
||||
window.scroot = scroot;
|
||||
|
|
Loading…
Reference in a new issue