datasetList.add(new DefaultBoxAndWhiskerCategoryDataset()); datasetList.get(i).add( distributionLevelList.get(i), solverLabel,
/** * Adds a list of values relating to one box-and-whisker entity to the * table. The various median values are calculated. * * @param list a collection of values from which the various medians will * be calculated. * @param rowKey the row key ({@code null} not permitted). * @param columnKey the column key ({@code null} not permitted). * * @see #add(BoxAndWhiskerItem, Comparable, Comparable) */ public void add(List list, Comparable rowKey, Comparable columnKey) { BoxAndWhiskerItem item = BoxAndWhiskerCalculator .calculateBoxAndWhiskerStatistics(list); add(item, rowKey, columnKey); }
/** * Adds a list of values relating to one box-and-whisker entity to the * table. The various median values are calculated. * * @param list a collection of values from which the various medians will * be calculated. * @param rowKey the row key (<code>null</code> not permitted). * @param columnKey the column key (<code>null</code> not permitted). * * @see #add(BoxAndWhiskerItem, Comparable, Comparable) */ public void add(List list, Comparable rowKey, Comparable columnKey) { BoxAndWhiskerItem item = BoxAndWhiskerCalculator .calculateBoxAndWhiskerStatistics(list); add(item, rowKey, columnKey); }
/** * Adds a data series into the series collection. Vector <TT>data</TT> represents * a point set. Only <SPAN CLASS="textit">the first</SPAN> <TT>numPoints</TT> of * <TT>data</TT> will be added to the new series. * * @param data Point set * * @param numPoints Number of points to add * * @return Integer that represent the new point set's position in the JFreeChart <TT>DefaultBoxAndWhiskerXYDataset</TT> object. * */ public int add (double[] data, int numPoints) { DefaultBoxAndWhiskerCategoryDataset tempSeriesCollection = (DefaultBoxAndWhiskerCategoryDataset)seriesCollection; final List<Double> list = new ArrayList<Double>(); for (int i = 0; i < numPoints; i ++) list.add(data[i]); int count = tempSeriesCollection.getColumnCount(); tempSeriesCollection.add(list, 0, "Serie " + count); return count; }
/** * Creates a new <TT>BoxSeriesCollection</TT> instance with default * parameters and given data series. The input parameter represents series * of point sets. * * @param data series of point sets. * * */ public BoxSeriesCollection (double[]... data) { renderer = new BoxAndWhiskerRenderer(); seriesCollection = new DefaultBoxAndWhiskerCategoryDataset (); DefaultBoxAndWhiskerCategoryDataset tempSeriesCollection = (DefaultBoxAndWhiskerCategoryDataset)seriesCollection; for (int i = 0; i < data.length; i ++) { if (data[i].length == 0) throw new IllegalArgumentException("Unable to render the plot. data[" + i +"] contains no row"); final List<Double> list = new ArrayList<Double>(); for (int j = 0; j < data[i].length-1; j ++) list.add(data[i][j]); tempSeriesCollection.add(list, 0, "Serie " + i); list.clear(); } ((BoxAndWhiskerRenderer)renderer).setMaximumBarWidth(BARWIDTH); }
/** * Creates a new <TT>BoxSeriesCollection</TT> instance with default parameters * and input series <TT>data</TT>. Only <SPAN CLASS="textit">the first</SPAN> <TT>numPoints</TT> * of <TT>data</TT> will taken into account. * * @param data point sets. * * @param numPoints Number of points * * */ public BoxSeriesCollection (double[] data, int numPoints) { renderer = new BoxAndWhiskerRenderer(); ((BoxAndWhiskerRenderer)renderer).setMaximumBarWidth(BARWIDTH); seriesCollection = new DefaultBoxAndWhiskerCategoryDataset (); DefaultBoxAndWhiskerCategoryDataset tempSeriesCollection = (DefaultBoxAndWhiskerCategoryDataset)seriesCollection; final List<Double> list = new ArrayList<Double>(); for (int i = 0; i < numPoints; i ++) list.add(data[i]); tempSeriesCollection.add(list, 0, 0); }
dataset.add (hourList[ii], "Last 30 days", "" + ii);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DefaultBoxAndWhiskerCategoryDataset data = new DefaultBoxAndWhiskerCategoryDataset(); data.add(getInputData(), ROW_KEY, "Coruscant"); JFreeChart chart = ChartFactory.createBoxAndWhiskerChart( "Box and Whisker Chart", ROW_KEY, "Temperature", data, false);
maxOutlier, outliers); dataset.add(item, "", "");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DefaultBoxAndWhiskerCategoryDataset data = new DefaultBoxAndWhiskerCategoryDataset(); data.add(Arrays.asList(30, 36, 46, 55, 65, 76, 81, 80, 71, 59, 44, 34), "Planet", "Endor"); JFreeChart chart = ChartFactory.createBoxAndWhiskerChart( "Box and Whisker Chart", "Planet", "Temperature", data, false);
for (List<Double> values : list) { String category = columns.get(i); dataset.add(values, "s" + row++, category);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DefaultBoxAndWhiskerCategoryDataset boxData = new DefaultBoxAndWhiskerCategoryDataset(); boxData.add(Arrays.asList(30, 36, 46, 55, 65, 76, 81, 80, 71, 59, 44, 34), "Planet", "Endor"); boxData.add(Arrays.asList(22, 25, 34, 44, 54, 63, 69, 67, 59, 48, 38, 28), "Planet", "Hoth"); BoxAndWhiskerRenderer boxRenderer = new BoxAndWhiskerRenderer(); DefaultCategoryDataset catData = new DefaultCategoryDataset();
boxPlotDataset.add(listValues, sparklineDataSeries.getSeriesLabel(), "1");
@Override public void afterDetailEval(ReportParameters reportParameters) { super.afterDetailEval(reportParameters); String series = reportParameters.getValue("series"); String category = reportParameters.getValue("category"); Double mean = reportParameters.getValue("mean"); Double median = reportParameters.getValue("median"); Double q1 = reportParameters.getValue("q1"); Double q3 = reportParameters.getValue("q3"); Double minRegularValue = reportParameters.getValue("minregularvalue"); Double maxRegularValue = reportParameters.getValue("maxregularvalue"); Double minOutlier = reportParameters.getValue("minoutlier"); Double maxOutlier = reportParameters.getValue("maxoutlier"); BoxAndWhiskerItem item = new BoxAndWhiskerItem(mean, median, q1, q3, minRegularValue, maxRegularValue, minOutlier, maxOutlier, null); dataset.add(item, series, category); } }