From 9107566b3828fb91fd7294043b43f91d42ef9a95 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Thu, 23 May 2013 16:18:38 -0500 Subject: [PATCH] Fix bug where plotted series were not labelled correctly in the legend. --- core/src/net/sf/openrocket/gui/plot/SimulationPlot.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java b/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java index 05d2de63e..043617a51 100644 --- a/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java +++ b/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java @@ -153,7 +153,6 @@ public class SimulationPlot { Unit unit = filled.getUnit(i); int axis = filled.getAxis(i); String name = getLabel(type, unit); - this.legendItems.lineLabels.add(name); List seriesNames = Util.generateSeriesLabels(simulation); @@ -167,7 +166,7 @@ public class SimulationPlot { List plotx = thisBranch.get(domainType); List ploty = thisBranch.get(type); XYSeries series = new XYSeries(seriesNames.get(branchIndex) + ": " + name, false, true); - series.setDescription(thisBranch.getBranchName() + ": " + name); + series.setDescription(name); int pointCount = plotx.size(); for (int j = 0; j < pointCount; j++) { series.add(domainUnit.toUnit(plotx.get(j)), unit.toUnit(ploty.get(j))); @@ -250,6 +249,8 @@ public class SimulationPlot { } // Now we pull the colors for the legend. for (int j = 0; j < data[i].getSeriesCount(); j += branchCount) { + String name = data[i].getSeries(j).getDescription(); + this.legendItems.lineLabels.add(name); Paint linePaint = r.lookupSeriesPaint(j); this.legendItems.linePaints.add(linePaint); Shape itemShape = r.lookupSeriesShape(j);