diff --git a/tools.descartes.pavo/src/tools/descartes/pavo/types/Historgram.java b/tools.descartes.pavo/src/tools/descartes/pavo/types/Historgram.java index ad29e3d919daa43d1bf2029af6822acd277f3a74..1c045d89363164f870bc4fb39830f9d4423bac35 100644 --- a/tools.descartes.pavo/src/tools/descartes/pavo/types/Historgram.java +++ b/tools.descartes.pavo/src/tools/descartes/pavo/types/Historgram.java @@ -53,13 +53,11 @@ import tools.descartes.pavo.result.ResultContainerPavo; import tools.descartes.pavo.result.SeriesResultPavo; /** - * Class to visualise the current result as Histogram if possible. Can visualise - * results constiting only out of series results. If the y axis descrition is - * "Frequency" the y values will be used as count for the x values. Removing the + * Class to visualize the current series results as histogram. Removes the * confidence button and adding a spinner for the choice of number of bins - * buttons * - * @author Maximilian König <max.c.koenig@t-online.de> + * @author Jürgen Walter <juergen.walter@uni-wuerzburg.de> + * @author Maximilian König <max.c.koenig@t-online.de> * @since 2016 */ public class Historgram extends AbstractVisualizationType implements IVisualizationType { @@ -84,24 +82,11 @@ public class Historgram extends AbstractVisualizationType implements IVisualizat for (AbstractQuantitativeResult r : this.getResult().getResults()) { if (r instanceof SeriesResultPavo) { LinkedList<Double> list = new LinkedList<>(); - if (r.getScaleY().equals("Frequency")) { - - for (int j = 0; j < ((SeriesResultPavo) r).getValues().size(); j++) { - Double a = ((SeriesResultPavo) r).getValues().get(j).getY(); - while (a > 0) { - - list.add(((SeriesResultPavo) r).getValues().get(j).getX()); - a--; - } - - } - } else { - for (int i = 0; i < ((SeriesResultPavo) r).getValues().size(); i++) { - list.add(((SeriesResultPavo) r).getValues().get(i).getX()); - - } + for (int i = 0; i < ((SeriesResultPavo) r).getValues().size(); i++) { + list.add(((SeriesResultPavo) r).getValues().get(i).getY()); } + double[] array = new double[list.size()]; for (int i = 0; i < list.size(); i++) { array[i] = list.get(i); // Watch out for @@ -111,8 +96,8 @@ public class Historgram extends AbstractVisualizationType implements IVisualizat } } - String xaxis = this.getXDescription(); - String yaxis = this.getYDescription(); + String xaxis = this.getYDescription(); + String yaxis = "Frequency"; JFreeChart chart = ChartFactory.createHistogram("", xaxis, yaxis, dataset, PlotOrientation.VERTICAL, false, false, false); XYPlot plot = (XYPlot) chart.getPlot();