server.js: properly respect maxpoints
This commit is contained in:
parent
6cfa299371
commit
7c6c2fdc85
|
@ -77,7 +77,7 @@ function add_plot_data(newpoints, render=true) {
|
||||||
}
|
}
|
||||||
plot_data[key].x.push(point[1]);
|
plot_data[key].x.push(point[1]);
|
||||||
plot_data[key].y.push(point[2]);
|
plot_data[key].y.push(point[2]);
|
||||||
if (plot_data[key].x.length > localstate.maxpoints) {
|
while (plot_data[key].x.length > localstate.maxpoints) {
|
||||||
plot_data[key].x.shift();
|
plot_data[key].x.shift();
|
||||||
plot_data[key].y.shift();
|
plot_data[key].y.shift();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue