JFreeChart chart; // initialize the chart chart.setPadding(new RectangleInsets(50, 0, 0, 0));
public OperationsVersusSizePlot( String title, String ylabel) { chart = ChartFactory.createXYLineChart(title, "Matrix Size", ylabel, null, PlotOrientation.VERTICAL, true , false , false ); // chart.removeLegend(); plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); // final NumberAxis rangeAxis = new LogarithmicAxis(ylabel); // plot.setRangeAxis(rangeAxis); // one of the numbers is getting cropped. this will make it fully visible chart.setPadding(new RectangleInsets(5,0,0,5)); }
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));
chart.setPadding(new RectangleInsets(10,5,5,5)); chart.setBorderVisible(true); chart.setBorderPaint(parseColor("#cccccc"));
private byte[] generateBoxAndWhiskerChart (BoxAndWhiskerCategoryDataset dataset, int width, int height) { JFreeChart chart = ChartFactory.createBoxAndWhiskerChart (null, null, null, dataset, false); // set background chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ())); // set chart border chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc")); // set anti alias chart.setAntiAlias (true); CategoryPlot plot = (CategoryPlot) chart.getPlot (); plot.setDomainGridlinePaint (Color.white); plot.setDomainGridlinesVisible (true); plot.setRangeGridlinePaint (Color.white); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis (); rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ()); CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis (); domainAxis.setLowerMargin (0.0); domainAxis.setUpperMargin (0.0); BufferedImage img = chart.createBufferedImage (width, height); final ByteArrayOutputStream out = new ByteArrayOutputStream(); try{ ImageIO.write(img, "png", out); }catch(IOException e){ log.warn("Error occurred while generating SiteStats chart image data", e); } return out.toByteArray(); }
chart.setPadding(new RectangleInsets(5,5,5,5)); plot.setInsets(new RectangleInsets(1,1,1,1));
chart.setPadding(new RectangleInsets(10,5,5,5)); chart.setBorderVisible(true); chart.setBorderPaint(parseColor("#cccccc"));
/** * Creates a sparkline chart. * * @return A sparkline chart. */ private static JFreeChart createSparklineChart() { GXYPlot plot = new GXYPlot(); plot.setInsets(RectangleInsets.ZERO_INSETS); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setBaseShapesVisible(false); plot.setRenderer(renderer); JFreeChart chart = new JFreeChart(plot); chart.setPadding(RectangleInsets.ZERO_INSETS); chart.removeLegend(); chart.setBackgroundPaint(Color.white); renderer.setBasePaint(new Color(0xFF9900)); renderer.setBaseStroke(new BasicStroke(1.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); renderer.setAutoPopulateSeriesPaint(false); GValueAxis xAxis = new GValueAxis(); xAxis.setVisible(false); plot.setDomainAxis(xAxis); GValueAxis yAxis = new GValueAxis(); yAxis.setVisible(false); plot.setRangeAxis(yAxis); plot.setDomainGridlinesVisible(false); plot.setRangeGridlinesVisible(false); return chart; }
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));
chart.setPadding(new RectangleInsets(10,5,5,5)); chart.setBorderVisible(true); chart.setBorderPaint(parseColor("#cccccc"));
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));
chart.setPadding (new RectangleInsets (10, 5, 5, 5)); chart.setBorderVisible (true); chart.setBorderPaint (parseColor ("#cccccc"));