diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java index 041278370..e157bd9e0 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java @@ -260,6 +260,7 @@ public class SimulationPlot extends Plot time = dataBranch.get(FlightDataType.TYPE_TIME); + String tName = FlightDataType.TYPE_TIME.getName(); List domain = dataBranch.get(config.getDomainAxisType()); LinearInterpolator domainInterpolator = new LinearInterpolator(time, domain); String xName = config.getDomainAxisType().getName(); @@ -317,11 +318,11 @@ public class SimulationPlot extends Plot events, String xName, double dataX, String unitX, String yName, double dataY, String unitY, int sampleIdx) { + protected String formatEventTooltip(String dataName, Set events, + String tName, double time, String unitT, + String xName, double dataX, String unitX, + String yName, double dataY, String unitY, int sampleIdx) { String ord_end = getOrdinalEnding(sampleIdx); + DecimalFormat df_t = DecimalFormatter.df(time, 2, false); DecimalFormat df_y = DecimalFormatter.df(dataY, 2, false); DecimalFormat df_x = DecimalFormatter.df(dataX, 2, false); @@ -371,7 +376,10 @@ public class SimulationPlot extends Plot"); } - + + if (!tName.equals(xName)) { + sb.append(String.format("%s: %s %s
", tName, df_t.format(time), unitT)); + } sb.append(String.format("%s: %s %s
", xName, df_x.format(dataX), unitX)); sb.append(String.format("%s: %s %s
", yName, df_y.format(dataY), unitY)); sb.append(String.format("%d%s sample", sampleIdx, ord_end));