List of usage examples for org.jfree.chart.title LegendTitle setPosition
public void setPosition(RectangleEdge position)
From source file:net.sf.jasperreports.components.spiderchart.SpiderChartRendererEvaluator.java
/** * /*from w w w . j av a 2 s . c om*/ */ public static Renderable evaluateRenderable(JasperReportsContext jasperReportsContext, JRComponentElement element, SpiderChartSharedBean spiderchartBean, ChartCustomizer chartCustomizer, String defaultRenderType, String datasetType) { SpiderChartComponent chartComponent = (SpiderChartComponent) element.getComponent(); ChartSettings chartSettings = chartComponent.getChartSettings(); SpiderPlot plot = (SpiderPlot) chartComponent.getPlot(); DefaultCategoryDataset dataset = null; StandardCategoryItemLabelGenerator labelGenerator = null; if (FILL_DATASET.equals(datasetType)) { dataset = ((FillSpiderDataset) spiderchartBean.getDataset()).getCustomDataset(); labelGenerator = ((FillSpiderDataset) spiderchartBean.getDataset()).getLabelGenerator(); } else { dataset = getSampleDataset(); labelGenerator = new StandardCategoryItemLabelGenerator(); } SpiderWebPlot spiderWebPlot = new SpiderWebPlot(dataset); if (plot.getAxisLineColor() != null) { spiderWebPlot.setAxisLinePaint(plot.getAxisLineColor()); } if (plot.getAxisLineWidth() != null) { spiderWebPlot.setAxisLineStroke(new BasicStroke(plot.getAxisLineWidth())); } if (plot.getBackcolor() != null) { spiderWebPlot.setBackgroundPaint(plot.getBackcolor()); } if (plot.getBackgroundAlpha() != null) { spiderWebPlot.setBackgroundAlpha(plot.getBackgroundAlpha()); } if (plot.getForegroundAlpha() != null) { spiderWebPlot.setForegroundAlpha(plot.getForegroundAlpha()); } if (plot.getHeadPercent() != null) { spiderWebPlot.setHeadPercent(plot.getHeadPercent()); } if (plot.getInteriorGap() != null) { spiderWebPlot.setInteriorGap(plot.getInteriorGap()); } if (plot.getLabelColor() != null) { spiderWebPlot.setLabelPaint(plot.getLabelColor()); } if (plot.getLabelFont() != null) { spiderWebPlot.setLabelFont(FontUtil.getInstance(jasperReportsContext).getAwtFont(plot.getLabelFont(), Locale.getDefault())); } if (plot.getLabelGap() != null) { spiderWebPlot.setAxisLabelGap(plot.getLabelGap()); } if (spiderchartBean.getMaxValue() != null) { spiderWebPlot.setMaxValue(spiderchartBean.getMaxValue()); } if (plot.getRotation() != null) { spiderWebPlot.setDirection(plot.getRotation().getRotation()); } if (plot.getStartAngle() != null) { spiderWebPlot.setStartAngle(plot.getStartAngle()); } if (plot.getTableOrder() != null) { spiderWebPlot.setDataExtractOrder(plot.getTableOrder().getOrder()); } if (plot.getWebFilled() != null) { spiderWebPlot.setWebFilled(plot.getWebFilled()); } spiderWebPlot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); spiderWebPlot.setLabelGenerator(labelGenerator); Font titleFont = chartSettings.getTitleFont() != null ? FontUtil.getInstance(jasperReportsContext) .getAwtFont(chartSettings.getTitleFont(), Locale.getDefault()) : TextTitle.DEFAULT_FONT; String titleText = spiderchartBean.getTitleText(); JFreeChart jfreechart = new JFreeChart(titleText, titleFont, spiderWebPlot, true); Color backcolor = chartSettings.getBackcolor() != null ? chartSettings.getBackcolor() : element.getBackcolor(); if (backcolor != null) { jfreechart.setBackgroundPaint(backcolor); } RectangleEdge titleEdge = getEdge(chartSettings.getTitlePosition(), RectangleEdge.TOP); if (titleText != null) { TextTitle title = jfreechart.getTitle(); title.setText(titleText); if (chartSettings.getTitleColor() != null) { title.setPaint(chartSettings.getTitleColor()); } title.setFont(titleFont); title.setPosition(titleEdge); jfreechart.setTitle(title); } String subtitleText = spiderchartBean.getSubtitleText(); if (subtitleText != null) { TextTitle subtitle = new TextTitle(subtitleText); subtitle.setText(subtitleText); if (chartSettings.getSubtitleColor() != null) { subtitle.setPaint(chartSettings.getSubtitleColor()); } if (chartSettings.getSubtitleColor() != null) { Font subtitleFont = chartSettings.getSubtitleFont() != null ? FontUtil.getInstance(jasperReportsContext).getAwtFont(chartSettings.getSubtitleFont(), Locale.getDefault()) : TextTitle.DEFAULT_FONT; subtitle.setFont(subtitleFont); } subtitle.setPosition(titleEdge); jfreechart.addSubtitle(subtitle); } // Apply all of the legend formatting options LegendTitle legend = jfreechart.getLegend(); if (legend != null) { legend.setVisible((chartSettings.getShowLegend() == null || chartSettings.getShowLegend())); if (legend.isVisible()) { if (chartSettings.getLegendColor() != null) { legend.setItemPaint(chartSettings.getLegendColor()); } if (chartSettings.getLegendBackgroundColor() != null) { legend.setBackgroundPaint(chartSettings.getLegendBackgroundColor()); } if (chartSettings.getLegendFont() != null) { legend.setItemFont(FontUtil.getInstance(jasperReportsContext) .getAwtFont(chartSettings.getLegendFont(), Locale.getDefault())); } legend.setPosition(getEdge(chartSettings.getLegendPosition(), RectangleEdge.BOTTOM)); } } String renderType = chartSettings.getRenderType() == null ? defaultRenderType : chartSettings.getRenderType(); Rectangle2D rectangle = new Rectangle2D.Double(0, 0, element.getWidth(), element.getHeight()); if (chartCustomizer != null) { chartCustomizer.customize(jfreechart, chartComponent); } return ChartUtil.getInstance(jasperReportsContext).getChartRenderableFactory(renderType) .getRenderable(jasperReportsContext, jfreechart, spiderchartBean.getHyperlinkProvider(), rectangle); }
From source file:gavisualizer.LineChart.java
@Override public void generate() { // Creates Line Chart from variables JFreeChart chart = ChartFactory.createLineChart(_title, // chart title _axisLabelDomain, // domain axis label _axisLabelRange, // range axis label _dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend false, // tooltips false // urls );/* w w w .j a v a2 s . com*/ // Set the Plot to certain colors final CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.lightGray); plot.setOutlinePaint(Color.white); // Set Legend to the right of the chart final LegendTitle lt = (LegendTitle) chart.getLegend(); lt.setPosition(RectangleEdge.RIGHT); // Set paints for lines in the chart LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); DefaultDrawingSupplier dw = new DefaultDrawingSupplier(PAINTS, DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE); plot.setDrawingSupplier(dw); // Customize stroke width of the series ((AbstractRenderer) renderer).setAutoPopulateSeriesStroke(false); renderer.setBaseStroke(STROKE_WIDTH); renderer.setBaseShapesVisible(false); // Include dashed lines if necessary List<String> rows = _dataset.getRowKeys(); // See if the title includes Downloads (Dashed lines are for Download lines) if (rows.get(rows.size() - 1).endsWith("Downloads")) { // Set the start to half the rows int start = _dataset.getRowCount() / 2; // Create an initial value int init = 0; // Iterate through the Download lines while (start < _dataset.getRowCount()) { // Make sure series and legend have dashes renderer.setSeriesStroke(start, DASHED_STROKE); LegendItemCollection legend = renderer.getLegendItems(); LegendItem li = legend.get(start - 1); li.setLineStroke(DASHED_STROKE); // Make sure the color matches the undashed year renderer.setSeriesPaint(start, renderer.getItemPaint(init, 0)); init++; start++; } } // Customise the range axis... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setAutoRangeIncludesZero(true); _chart = chart; }
From source file:hudson.plugins.codeviation.RepositoryView.java
private JFreeChart createChart(CategoryDataset dataset, int max) { final JFreeChart chart = ChartFactory.createLineChart(null, // chart title null, // unused "counts", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls );//w w w . j av a2 s . com // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... final LegendTitle legend = chart.getLegend(); legend.setPosition(RectangleEdge.RIGHT); chart.setBackgroundPaint(Color.white); final CategoryPlot plot = chart.getCategoryPlot(); // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0)); plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); domainAxis.setCategoryMargin(0.0); final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setUpperBound(max * 1.2); rangeAxis.setLowerBound(0); final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); renderer.setStroke(new BasicStroke(4.0f)); // crop extra space around the graph plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0)); return chart; }
From source file:org.jreserve.gui.plot.charts.AbstractChart.java
protected void formatLegend(LegendTitle legend) { legend.setBackgroundPaint(format.getBackgroundColor()); legend.setItemPaint(format.getForeColor()); legend.setPosition(format.getLegendPosition()); }
From source file:openqcm.ChartDynamicData.java
public ChartDynamicData() { // add primary axis frequency TimeSeries seriesFrequency = new TimeSeries("Frequency (Hz)"); datasetFrequency = new TimeSeriesCollection(seriesFrequency); rangeAxisF = new NumberAxis("Frequency (Hz)"); XYItemRenderer renderer = new StandardXYItemRenderer(); renderer.setSeriesPaint(0, new Color(0, 142, 192)); rangeAxisF.setAutoRangeIncludesZero(false); rangeAxisF.setAutoRange(true);/* w ww . j a v a 2 s . com*/ rangeAxisF.setAutoRangeMinimumSize(50); plot.setDataset(0, datasetFrequency); plot.setRangeAxis(0, rangeAxisF); plot.setRangeAxisLocation(0, AxisLocation.BOTTOM_OR_LEFT); plot.setRenderer(0, renderer); plot.mapDatasetToRangeAxis(0, 0); // add secondary axis temperature TimeSeries seriesTemperature = new TimeSeries("Temperature (C)"); datasetTemperature = new TimeSeriesCollection(seriesTemperature); plot.setDataset(1, datasetTemperature); NumberAxis rangeAxisT = new NumberAxis("Temperature (C)"); rangeAxisT.setAutoRangeIncludesZero(false); rangeAxisT.setAutoRange(true); rangeAxisT.setAutoRangeMinimumSize(5); plot.setRangeAxis(1, rangeAxisT); plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT); // custom renderer for dinamically changing temperaure rendererT.setSeriesPaint(0, new Color(255, 128, 0)); plot.setRenderer(1, rendererT); plot.mapDatasetToRangeAxis(1, 1); plotComb.add(plot); plotComb.setBackgroundPaint(Color.white); plotComb.setDomainGridlinePaint(Color.white); plotComb.setRangeGridlinePaint(Color.white); // enable panning for both axis plotComb.setRangePannable(true); plotComb.setDomainPannable(true); // set time axis properties // format time axis as hh:mm:ss SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); DateAxis axis = (DateAxis) plotComb.getDomainAxis(); axis.setDateFormatOverride(format); // default auto range domainAxis.setAutoRange(true); // init the JFreeChart JFreeChart chart = new JFreeChart(plotComb); chart.setBorderPaint(Color.lightGray); chart.setBorderVisible(true); chart.setBackgroundPaint(Color.white); // set legend properties LegendTitle legend = chart.getLegend(); legend.setPosition(RectangleEdge.TOP); legend.setItemFont(new Font("Dialog", Font.PLAIN, 9)); // constructor for org.jfree.chart.ChartPanel // ChartPanel(JFreeChart chart, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) ChartPanel chartPanel = new ChartPanel(chart, false, true, true, true, true); // enable mouse wheel support for the chart panel chartPanel.setMouseWheelEnabled(true); this.setLayout(new BorderLayout()); // add real time chart to the frame this.add(chartPanel); this.validate(); }
From source file:com.itemanalysis.jmetrik.graph.nicc.NonparametricCurvePanel.java
private void createChart(String name, String title, String xLabel, String yLabel, double minScore, double maxScore) { XYSeriesCollection dataset = new XYSeriesCollection(); final JFreeChart chart = ChartFactory.createXYLineChart(title, // chart title xLabel, // x axis label yLabel, // y axis label dataset, // data chartOrientation, // chart orientation showLegend, // include legend true, // tooltips false // urls );// w w w. jav a2s . c om if (showLegend) { LegendTitle chartTitle = chart.getLegend(); chartTitle.setPosition(legendPosition); } XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setRangeGridlinePaint(Color.LIGHT_GRAY); plot.setDomainGridlinePaint(Color.LIGHT_GRAY); // //can use this code to fix the number of tick marks on the y-axis // NumberFormat myFormatter = new DecimalFormat("#.0"); // NumberAxis yaxis = (NumberAxis)plot.getRangeAxis(); // yaxis.setTickUnit(new NumberTickUnit(.1, myFormatter)); ChartPanel panel = new ChartPanel(chart); panel.getPopupMenu().addSeparator(); panel.setPreferredSize(new Dimension(width, height)); // this.addLocalEPSMenuItem(this, panel.getPopupMenu(), chart);//remove this line for public release versions chart.setPadding(new RectangleInsets(20.0, 5.0, 20.0, 5.0)); charts.put(name, chart); JPanel subPanel = new JPanel();//additional panel needed to prevent gridlayout from stretching graph subPanel.add(panel); subPanel.setBackground(Color.WHITE); this.add(subPanel); }
From source file:reports.util.BarChart2Scriptlet.java
/** * *//*from w w w . ja va 2 s . co m*/ public void afterReportInit() throws JRScriptletException { JFreeChart jfreechart = ChartFactory.createBarChart("Bar Chart Demo", // chart title "States", // X Label "Sell Amount", // Y Label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = jfreechart.getCategoryPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setDomainGridlinePaint(Color.white); categoryplot.setRangeGridlinePaint(Color.white); LegendTitle legendtitle = (LegendTitle) jfreechart.getSubtitle(0); legendtitle.setPosition(RectangleEdge.RIGHT); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); IntervalMarker intervalmarker = new IntervalMarker(200D, 250D); intervalmarker.setLabel("Target Range"); intervalmarker.setLabelFont(new Font("SansSerif", 2, 11)); intervalmarker.setLabelAnchor(RectangleAnchor.LEFT); intervalmarker.setLabelTextAnchor(TextAnchor.CENTER_LEFT); intervalmarker.setPaint(new Color(222, 222, 255, 128)); categoryplot.addRangeMarker(intervalmarker, Layer.BACKGROUND); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); barrenderer.setItemMargin(0.10000000000000001D); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0)); GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0)); barrenderer.setSeriesPaint(0, gradientpaint); barrenderer.setSeriesPaint(1, gradientpaint1); barrenderer.setSeriesPaint(2, gradientpaint2); barrenderer.setItemLabelGenerator(new LabelGenerator()); barrenderer.setItemLabelsVisible(true); //ItemLabelPosition itemlabelposition = new ItemLabelPosition(ItemLabelAnchor.INSIDE12, TextAnchor.CENTER_RIGHT, TextAnchor.CENTER_RIGHT, -1.5707963267948966D); //barrenderer.setPositiveItemLabelPosition(itemlabelposition); ItemLabelPosition itemlabelposition1 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_LEFT, -1.5707963267948966D); barrenderer.setPositiveItemLabelPositionFallback(itemlabelposition1); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); /* */ this.setVariableValue("Chart", new JCommonDrawableRenderer(jfreechart)); }
From source file:reports.util.BarChartScriptlet.java
/** * *//* ww w . j av a 2s.c om*/ public void afterReportInit() throws JRScriptletException { JFreeChart jfreechart = ChartFactory.createBarChart3D("Bar Chart Demo", // chart title "States", // X Label "Sell Amount", // Y Label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); CategoryPlot categoryplot = jfreechart.getCategoryPlot(); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(0.39269908169872414D)); LegendTitle legendtitle = (LegendTitle) jfreechart.getSubtitle(0); legendtitle.setPosition(RectangleEdge.RIGHT); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); IntervalMarker intervalmarker = new IntervalMarker(4000D, 5000D); intervalmarker.setLabel("Target Range"); intervalmarker.setLabelFont(new Font("SansSerif", 2, 11)); intervalmarker.setLabelAnchor(RectangleAnchor.LEFT); intervalmarker.setLabelTextAnchor(TextAnchor.CENTER_LEFT); intervalmarker.setPaint(new Color(222, 222, 255, 128)); categoryplot.addRangeMarker(intervalmarker, Layer.BACKGROUND); CategoryItemRenderer categoryitemrenderer = categoryplot.getRenderer(); categoryitemrenderer.setItemLabelsVisible(true); BarRenderer barrenderer = (BarRenderer) categoryitemrenderer; barrenderer.setMaxBarWidth(0.050000000000000003D); barrenderer.setItemLabelGenerator(new LabelGenerator()); barrenderer.setItemLabelsVisible(true); ItemLabelPosition itemlabelposition1 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_LEFT, -1.5707963267948966D); barrenderer.setPositiveItemLabelPositionFallback(itemlabelposition1); categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); /* jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = jfreechart.getCategoryPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setDomainGridlinePaint(Color.white); categoryplot.setDomainGridlinesVisible(true); categoryplot.setRangeGridlinePaint(Color.white); NumberAxis numberaxis = (NumberAxis)categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer)categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0)); GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0)); barrenderer.setSeriesPaint(0, gradientpaint); barrenderer.setSeriesPaint(1, gradientpaint1); barrenderer.setSeriesPaint(2, gradientpaint2); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D)); */ this.setVariableValue("Chart", new JCommonDrawableRenderer(jfreechart)); }
From source file:org.squale.squaleweb.util.graph.KiviatMaker.java
/** * Create the JreeChart object//from w w w . ja v a 2 s . co m * * @param showLegend indicate if it should display the legend or not * @param showBackground indicate if we want showBackground * @return The JreeChart object */ public JFreeChart getChart(boolean showLegend, boolean showBackground) { JFreeChart retChart = super.getChart(); // Creation of the graph if it not already exist if (null == retChart) { // Creation of the plot SpiderWebPlot plot = new SpiderWebPlot(mDataset); // Creation of the picture. The plot is inside the picture retChart = new JFreeChart(mTitle, TextTitle.DEFAULT_FONT, plot, false); // Display of the legend if (showLegend) { LegendTitle legendtitle = new LegendTitle(plot); legendtitle.setPosition(RectangleEdge.BOTTOM); retChart.addSubtitle(legendtitle); } // Definition of the style of the three first draw in the spiderWEbPlot. // This three first draw represent the scale for the mark 1.0, 2.0 and 3.0 in the plot // First we define the style final float miterLimit = 10.0f; final float[] dashPattern = { 5.0f, 3.0f }; BasicStroke dash = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, // End cap BasicStroke.JOIN_MITER, // Join style miterLimit, // Miter limit dashPattern, // Dash pattern 0.0f); // We associate this style to the draw plot.setSeriesPaint(0, new Color(WebMessages.getInt("kiviat.color.1"))); plot.setSeriesOutlineStroke(0, dash); plot.setSeriesPaint(1, new Color(WebMessages.getInt("kiviat.color.2"))); plot.setSeriesOutlineStroke(1, dash); plot.setSeriesPaint(2, new Color(WebMessages.getInt("kiviat.color.3"))); plot.setSeriesOutlineStroke(2, dash); // Define the gap what is draw and the border of the plot plot.setInteriorGap(DEFAULT_GAP); // Define the style of the line stroke plot.setBaseSeriesOutlineStroke(new BasicStroke(2.0f)); // The max value put in the plot (for the scale) plot.setMaxValue(SCALE_MAX_VALUE); // Indicate if we want fill the inner of the draw plot.setWebFilled(FILL_RADAR); if (!showBackground) { // Set the background of the picture to white retChart.setBackgroundPaint(Color.WHITE); // Set the border of the plot to white plot.setOutlinePaint(Color.WHITE); } super.setChart(retChart); } return retChart; }
From source file:com.rapidminer.gui.viewer.ROCChartPlotter.java
public void paintDeviationChart(Graphics graphics, int width, int height) { prepareData();//from w ww .java 2 s . c om JFreeChart chart = createChart(this.dataset); // set the background color for the chart... chart.setBackgroundPaint(Color.white); // legend settings LegendTitle legend = chart.getLegend(); if (legend != null) { legend.setPosition(RectangleEdge.TOP); legend.setFrame(BlockBorder.NONE); legend.setHorizontalAlignment(HorizontalAlignment.LEFT); } Rectangle2D drawRect = new Rectangle2D.Double(0, 0, width, height); chart.draw((Graphics2D) graphics, drawRect); }