1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-26 20:54:22 +01:00

Empty graph hack fixes #4722 and fixes #5316

This commit is contained in:
xloem 2016-09-30 16:56:57 -04:00 committed by GitHub
parent ec2e9a642a
commit be01c39c3a

View File

@ -87,8 +87,10 @@ public class SerialPlotter extends AbstractMonitor {
minY = Double.POSITIVE_INFINITY;
maxY = Double.NEGATIVE_INFINITY;
for(Graph g : graphs) {
minY = Math.min(g.buffer.min(), minY);
maxY = Math.max(g.buffer.max(), maxY);
if (!g.buffer.isEmpty()) {
minY = Math.min(g.buffer.min(), minY);
maxY = Math.max(g.buffer.max(), maxY);
}
}
final double MIN_DELTA = 10.0;