mirror of
https://github.com/nasa/trick.git
synced 2025-01-29 23:54:10 +00:00
Two Java plot fixes (#665)
* MinY and MaxY of Plot axis should never be the same, even with flatline data. * In addition to a null check, add a empty units String check.
This commit is contained in:
parent
c112290265
commit
fcbd99aaf4
@ -323,7 +323,8 @@ public abstract class DataReader {
|
||||
varData = varData + theVar.getBias().doubleValue();
|
||||
}
|
||||
|
||||
if (theVar.getUnits() != null) {
|
||||
String theUnits = theVar.getUnits();
|
||||
if ((theUnits != null) && (theUnits != "")) {
|
||||
varData = convertUnits(varData, getLogVar(theVar.getName()), theVar);
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,11 @@ public class TrickXYPlot extends XYPlot {
|
||||
maxY = Math.max(maxY, dataset.getSeries(i).getMaxY());
|
||||
}
|
||||
guiXAxis.setRange(minX, maxX);
|
||||
|
||||
if (minY == maxY) {
|
||||
minY -= 1.0;
|
||||
maxY += 1.0;
|
||||
}
|
||||
guiYAxis.setRange(minY, maxY);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user