X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fplot%2FPlotDialog.java;fp=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fplot%2FPlotDialog.java;h=a6a921a07340170042b2dd67b0cc64ac4449c744;hb=0d0afe488300aca47d09ac7651f8185190afb21f;hp=e08525d64698b9ac339c5e53a80caeeaf2d49d17;hpb=6afc62224f6f7e581b1d321e125ed97a6ec77dc1;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/gui/plot/PlotDialog.java b/src/net/sf/openrocket/gui/plot/PlotDialog.java index e08525d6..a6a921a0 100644 --- a/src/net/sf/openrocket/gui/plot/PlotDialog.java +++ b/src/net/sf/openrocket/gui/plot/PlotDialog.java @@ -56,12 +56,26 @@ public class PlotDialog extends JDialog { throw new IllegalArgumentException("Domain axis type not specified."); } List x = branch.get(domainType); - + + + // Get plot length (ignore trailing NaN's) + int typeCount = filled.getTypeCount(); + int dataLength = 0; + for (int i=0; i y = branch.get(type); + + for (int j = dataLength; j < y.size(); j++) { + if (!Double.isNaN(y.get(j)) && !Double.isInfinite(y.get(j))) + dataLength = j; + } + } + dataLength = Math.min(dataLength, x.size()); + // Create the XYSeries objects from the flight data and store into the collections - int length = filled.getTypeCount(); String[] axisLabel = new String[2]; - for (int i = 0; i < length; i++) { + for (int i = 0; i < typeCount; i++) { // Get info FlightDataBranch.Type type = filled.getType(i); Unit unit = filled.getUnit(i); @@ -71,7 +85,7 @@ public class PlotDialog extends JDialog { // Store data in provided units List y = branch.get(type); XYSeries series = new XYSeries(name, false, true); - for (int j=0; j