mirror of
https://github.com/nasa/trick.git
synced 2025-06-18 07:08:17 +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:
@ -323,7 +323,8 @@ public abstract class DataReader {
|
|||||||
varData = varData + theVar.getBias().doubleValue();
|
varData = varData + theVar.getBias().doubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theVar.getUnits() != null) {
|
String theUnits = theVar.getUnits();
|
||||||
|
if ((theUnits != null) && (theUnits != "")) {
|
||||||
varData = convertUnits(varData, getLogVar(theVar.getName()), theVar);
|
varData = convertUnits(varData, getLogVar(theVar.getName()), theVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,11 @@ public class TrickXYPlot extends XYPlot {
|
|||||||
maxY = Math.max(maxY, dataset.getSeries(i).getMaxY());
|
maxY = Math.max(maxY, dataset.getSeries(i).getMaxY());
|
||||||
}
|
}
|
||||||
guiXAxis.setRange(minX, maxX);
|
guiXAxis.setRange(minX, maxX);
|
||||||
|
|
||||||
|
if (minY == maxY) {
|
||||||
|
minY -= 1.0;
|
||||||
|
maxY += 1.0;
|
||||||
|
}
|
||||||
guiYAxis.setRange(minY, maxY);
|
guiYAxis.setRange(minY, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user