List of usage examples for org.jfree.chart.renderer.category BoxAndWhiskerRenderer setBaseOutlinePaint
public void setBaseOutlinePaint(Paint paint)
From source file:GeMSE.Visualization.BoxAndWhiskerPlot.java
private void Plot() { BoxAndWhiskerCategoryDataset dataset = CreateDataset(); CategoryAxis xAxis = new CategoryAxis("Type"); NumberAxis yAxis = new NumberAxis("Value"); yAxis.setAutoRangeIncludesZero(false); BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(false);// www . j av a 2 s. c om renderer.setArtifactPaint(Color.BLACK); renderer.setBaseOutlinePaint(Color.BLACK); renderer.setSeriesOutlinePaint(0, Color.BLACK); renderer.setSeriesPaint(0, Color.BLACK); renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator()); CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer); plot.setBackgroundPaint(new Color(0, 0, 0, 0)); JFreeChart chart = new JFreeChart(null, new Font("Courier New", Font.PLAIN, 10), plot, true); chart.removeLegend(); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(450, 270)); PlotPanel.setViewportView(chartPanel); }
From source file:br.upe.ecomp.dosa.controller.chart.FileBoxplotChartManager.java
private JFreeChart createChart(String title, String xLabel, String yLabel, BoxAndWhiskerCategoryDataset dataset, boolean logarithmicYAxis) { final CategoryAxis xAxis = new CategoryAxis("Sample"); final NumberAxis yAxis; if (logarithmicYAxis) { yAxis = new LogarithmicAxis("Fitness (Log10)"); ((LogarithmicAxis) yAxis).setExpTickLabelsFlag(true); } else {//from w w w . j av a 2 s.c o m yAxis = new NumberAxis("Fitness"); } yAxis.setAutoRangeIncludesZero(false); yAxis.setAutoRange(true); final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(true); renderer.setBaseCreateEntities(true); // renderer.setArtifactPaint(Color.green); renderer.setBaseOutlinePaint(Color.blue); renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator()); final JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(title, xAxis.getLabel(), yAxis.getLabel(), dataset, true); final CategoryPlot plot = chart.getCategoryPlot();// new CategoryPlot(dataset, xAxis, yAxis, // renderer); plot.setBackgroundPaint(Color.white); // chart.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.lightGray); plot.setRenderer(renderer); plot.setRangeAxis(yAxis); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return chart; }
From source file:gui.TraitViewerDialog.java
@SuppressWarnings("rawtypes") private ChartPanel getChart(int selectedRow) { ArrayList<Float> data = new ArrayList<Float>(); for (float[] row : tFile.getRows()) { if (row[selectedRow + 1] != (float) -99.0) { data.add(row[selectedRow + 1]); }//from w w w. j a v a 2s.c o m } BoxAndWhiskerItem a = BoxAndWhiskerCalculator.calculateBoxAndWhiskerStatistics(data); java.util.List l = new ArrayList(0); a = new BoxAndWhiskerItem(a.getMean(), a.getMedian(), a.getQ1(), a.getQ3(), a.getMinRegularValue(), a.getMaxRegularValue(), a.getMinRegularValue(), a.getMaxRegularValue(), l); traitstats.setText(showBoxAndWhiskerItem(a)); DefaultBoxAndWhiskerCategoryDataset ds2 = new DefaultBoxAndWhiskerCategoryDataset(); ds2.add(a, (Comparable) 1, (Comparable) 1); JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(null, null, null, ds2, false); chart.removeLegend(); // XYPlot plot = chart.getXYPlot(); CategoryPlot plot = chart.getCategoryPlot(); plot.getDomainAxis().setVisible(false); BoxAndWhiskerRenderer b = (BoxAndWhiskerRenderer) plot.getRenderer(); // b.setFillBox(false); b.setSeriesPaint(0, new Color(236, 55, 169)); b.setSeriesOutlinePaint(1, new Color(131, 79, 112)); b.setBaseOutlineStroke(new BasicStroke(1.0f)); // b.get b.setWhiskerWidth(0.8); b.setBaseOutlinePaint(new Color(84, 144, 201)); b.setDefaultEntityRadius(2); b.setMaximumBarWidth(0.18); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPopupMenu(null); return chartPanel; }