Skip to content
Snippets Groups Projects
Commit 92a6d47a authored by Jürgen Walter's avatar Jürgen Walter
Browse files

fixed histogram

parent 2c179039
No related branches found
No related tags found
No related merge requests found
......@@ -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 Jrgen Walter <juergen.walter@uni-wuerzburg.de>
* @author Maximilian Knig <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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment