datasetList.add(new DefaultBoxAndWhiskerCategoryDataset());
/** * Creates a new <TT>BoxSeriesCollection</TT> instance with an empty dataset. * */ public BoxSeriesCollection () { renderer = new BoxAndWhiskerRenderer(); seriesCollection = new DefaultBoxAndWhiskerCategoryDataset (); ((BoxAndWhiskerRenderer)renderer).setMaximumBarWidth(BARWIDTH); }
/** * 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); }
DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset ();
JFrame f = new JFrame("BoxPlot"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DefaultBoxAndWhiskerCategoryDataset data = new DefaultBoxAndWhiskerCategoryDataset(); data.add(getInputData(), ROW_KEY, "Coruscant"); JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(
JFrame f = new JFrame("BoxPlot"); 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(
dataset = new DefaultBoxAndWhiskerCategoryDataset(); for (int i = start; i < start + VISIBLE; i++) { List<List<Double>> list = data.get(i);
public JFreeChart createChart(final int nbr) { DefaultBoxAndWhiskerCategoryDataset dataset0 = new DefaultBoxAndWhiskerCategoryDataset(); DefaultBoxAndWhiskerCategoryDataset dataset1 = new DefaultBoxAndWhiskerCategoryDataset();
public JFreeChart createChart(final int nbr) { DefaultBoxAndWhiskerCategoryDataset dataset0 = new DefaultBoxAndWhiskerCategoryDataset(); DefaultBoxAndWhiskerCategoryDataset dataset1 = new DefaultBoxAndWhiskerCategoryDataset();
JFrame f = new JFrame("Test"); 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");
DefaultBoxAndWhiskerCategoryDataset boxPlotDataset = new DefaultBoxAndWhiskerCategoryDataset();