List of usage examples for org.jfree.chart.plot Plot setOutlineStroke
public void setOutlineStroke(Stroke stroke)
From source file:org.gvsig.gui.beans.graphic.GraphicChartPanel.java
public GraphicChartPanel() { dataset = new XYSeriesCollection(); createChart();/*from ww w .ja v a 2 s . c o m*/ initialize(); Plot plot = this.jPanelChart.getChart().getPlot(); plot.setOutlineStroke(new BasicStroke(1)); plot.setOutlinePaint(Color.black); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(new Color(245, 245, 245)); }
From source file:org.jfree.chart.demo.XYStepAreaChartDemo.java
/** * Creates a new demo.//from w ww . j a va2s. c om * * @param title the frame title. */ public XYStepAreaChartDemo(final String title) { super(title); this.xySeries = new XYSeries("Some data"); for (int i = 0; i < TEST_DATA.length; i++) { this.xySeries.add((Integer) TEST_DATA[i][0], (Integer) TEST_DATA[i][1]); } final XYSeriesCollection dataset = new XYSeriesCollection(this.xySeries); final JFreeChart chart = createChart(dataset); this.chartPanel = new ChartPanel(chart); // allow zooming // this.chartPanel.setHorizontalZoom(true); // this.chartPanel.setVerticalZoom(true); // size this.chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); // make stroke more striking final Plot plot = this.chartPanel.getChart().getPlot(); plot.setOutlineStroke(new BasicStroke(2)); plot.setOutlinePaint(Color.magenta); // add some components to make options changable final JPanel main = new JPanel(new BorderLayout()); final JPanel optionsPanel = new JPanel(); final String[] options = { ORIENT_VERT, ORIENT_HORIZ }; this.orientationComboBox = new JComboBox(options); this.orientationComboBox.addActionListener(this); optionsPanel.add(this.orientationComboBox); this.outlineCheckBox = new JCheckBox("Outline"); this.outlineCheckBox.addActionListener(this); optionsPanel.add(this.outlineCheckBox); optionsPanel.add(new JLabel("Base")); this.rangeBaseTextField = new JTextField("0", 5); this.rangeBaseTextField.addActionListener(this); optionsPanel.add(this.rangeBaseTextField); this.nullValuesCheckBox = new JCheckBox("NULL values"); this.nullValuesCheckBox.addActionListener(this); optionsPanel.add(this.nullValuesCheckBox); main.add(optionsPanel, BorderLayout.SOUTH); main.add(this.chartPanel); setContentPane(main); }
From source file:daylightchart.options.chart.PlotOptions.java
/** * {@inheritDoc}/* w w w .j a v a2s . co m*/ * * @see BaseChartOptions#updateChart(org.jfree.chart.JFreeChart) */ @Override public void updateChart(final JFreeChart chart) { final Plot plot = chart.getPlot(); plot.setBackgroundPaint(backgroundPaint); plot.setOutlinePaint(outlinePaint); plot.setOutlineStroke(outlineStroke); if (insets != null) { plot.setInsets(insets); } // Update axes Axis domainAxis = null; if (plot instanceof CategoryPlot) { final CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); } else if (plot instanceof XYPlot) { final XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); } if (domainAxis != null) { domainAxisOptions.setAxisProperties(domainAxis); } Axis rangeAxis = null; if (plot instanceof CategoryPlot) { final CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { final XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) { rangeAxisOptions.setAxisProperties(rangeAxis); } }
From source file:com.rcp.wbw.demo.editor.SWTPlotEditor.java
/** * Updates the plot properties to match the properties * defined on the panel./*from w w w . java 2 s . co m*/ * * @param plot * The plot. */ public void updatePlotProperties(Plot plot) { // set the plot properties... plot.setBackgroundPaint(SWTUtils.toAwtColor(getBackgroundPaint())); plot.setOutlinePaint(SWTUtils.toAwtColor(getOutlinePaint())); plot.setOutlineStroke(getOutlineStroke()); // set the axis properties if (this.domainAxisPropertyPanel != null) { Axis domainAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); } if (domainAxis != null) this.domainAxisPropertyPanel.setAxisProperties(domainAxis); } if (this.rangeAxisPropertyPanel != null) { Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis); } if (this.plotAppearance.getPlotOrientation() != null) { if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; p.setOrientation(this.plotAppearance.getPlotOrientation()); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; p.setOrientation(this.plotAppearance.getPlotOrientation()); } } }
From source file:es.unex.meigas.extFillData.FittingDataPanel.java
public FittingDataPanel(final LeastSquaresFit lsf, final Tree[] trees, final XYVariables xy) { super(Meigas.getMainFrame(), "Ajuste de datos", true); m_Lsf = lsf;// w ww. jav a2 s .c om m_Trees = trees; m_XY = xy; createChart(); initialize(); final Plot plot = this.jPanelChart.getChart().getPlot(); plot.setOutlineStroke(new BasicStroke(1)); plot.setOutlinePaint(Color.blue); }
From source file:com.xpn.xwiki.plugin.charts.ChartCustomizer.java
public static void customizePlot(Plot plot, ChartParams params) { if (params.get(ChartParams.PLOT_BACKGROUND_COLOR) != null) { plot.setBackgroundPaint(params.getColor(ChartParams.PLOT_BACKGROUND_COLOR)); }/*from ww w.j av a 2s. co m*/ if (params.get(ChartParams.PLOT_BACKGROUND_ALPHA) != null) { plot.setBackgroundAlpha(params.getFloat(ChartParams.PLOT_BACKGROUND_ALPHA).floatValue()); } if (params.get(ChartParams.PLOT_FOREGROUND_ALPHA) != null) { plot.setForegroundAlpha(params.getFloat(ChartParams.PLOT_FOREGROUND_ALPHA).floatValue()); } if (params.get(ChartParams.PLOT_INSERTS) != null) { plot.setInsets(params.getRectangleInsets(ChartParams.PLOT_INSERTS)); } if (params.get(ChartParams.PLOT_OUTLINE_COLOR) != null) { plot.setOutlinePaint(params.getColor(ChartParams.PLOT_OUTLINE_COLOR)); } if (params.get(ChartParams.PLOT_OUTLINE_STROKE) != null) { plot.setOutlineStroke(params.getStroke(ChartParams.PLOT_OUTLINE_STROKE)); } }
From source file:com.bdaum.zoom.report.internal.wizards.ReportComponent.java
private static void applyProperties(JFreeChart chart, Map<String, Object> properties) { if (properties != null) { String text = (String) properties.get(TITLE); if (text != null) { TextTitle title = chart.getTitle(); if (title == null) { title = new TextTitle(); chart.setTitle(title);//from w w w. jav a 2 s . com } title.setText(text); Font titleFont = (Font) properties.get(TITLEFONT); if (titleFont != null) title.setFont(titleFont); Paint paint = (Paint) properties.get(TITLECOLOR); if (paint != null) title.setPaint(paint); } else chart.setTitle((TextTitle) null); Plot plot = chart.getPlot(); Paint paint = (Paint) properties.get(BGCOLOR); if (paint != null) plot.setBackgroundPaint(paint); paint = (Color) properties.get(OUTLINEPAINT); if (paint != null) plot.setOutlinePaint(paint); Stroke stroke = (Stroke) properties.get(OUTLINESTROKE); if (stroke != null) plot.setOutlineStroke(stroke); PlotOrientation orientation = (PlotOrientation) properties.get(ORIENTATION); Axis domainAxis = null; Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); rangeAxis = p.getRangeAxis(); if (orientation != null) p.setOrientation(orientation); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); rangeAxis = p.getRangeAxis(); if (orientation != null) p.setOrientation(orientation); } if (domainAxis != null) applyAxisProperties(domainAxis, "x", properties); //$NON-NLS-1$ if (rangeAxis != null) applyAxisProperties(rangeAxis, "y", properties); //$NON-NLS-1$ Boolean anti = (Boolean) properties.get(ANTIALIAS); if (anti != null) chart.setAntiAlias(anti); paint = (Paint) properties.get(CANVASPAINT); if (paint != null) chart.setBackgroundPaint(paint); } }
From source file:ch.zhaw.simulation.diagram.charteditor.DefaultPlotEditor.java
/** * Updates the plot properties to match the properties defined on the panel. * //from w w w. j av a2 s .c o m * @param plot * The plot. */ @SuppressWarnings("deprecation") public void updatePlotProperties(Plot plot) { this.outlineStrokeSample.setStroke((Stroke) this.cbOutlineStroke.getSelectedItem()); // set the plot properties... plot.setOutlinePaint(getOutlinePaint()); plot.setOutlineStroke(getOutlineStroke()); plot.setBackgroundPaint(getBackgroundPaint()); plot.setInsets(getPlotInsets()); // then the axis properties... if (this.domainAxisPropertyPanel != null) { Axis domainAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); } if (domainAxis != null) { this.domainAxisPropertyPanel.setAxisProperties(domainAxis); } } if (this.rangeAxisPropertyPanel != null) { Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) { this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis); } } // Disabled because makes no sense for us // if (this.plotOrientation != null) { // if (plot instanceof CategoryPlot) { // CategoryPlot p = (CategoryPlot) plot; // p.setOrientation(this.plotOrientation); // } else if (plot instanceof XYPlot) { // XYPlot p = (XYPlot) plot; // p.setOrientation(this.plotOrientation); // } // } if (this.drawLines != null) { if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; CategoryItemRenderer r = p.getRenderer(); if (r instanceof LineAndShapeRenderer) { ((LineAndShapeRenderer) r).setLinesVisible(this.drawLines.booleanValue()); } } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; XYItemRenderer r = p.getRenderer(); if (r instanceof StandardXYItemRenderer) { ((StandardXYItemRenderer) r).setPlotLines(this.drawLines.booleanValue()); } } } if (this.drawShapes != null) { if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; CategoryItemRenderer r = p.getRenderer(); if (r instanceof LineAndShapeRenderer) { ((LineAndShapeRenderer) r).setShapesVisible(this.drawShapes.booleanValue()); } } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; XYItemRenderer r = p.getRenderer(); if (r instanceof StandardXYItemRenderer) { ((StandardXYItemRenderer) r).setBaseShapesVisible(this.drawShapes.booleanValue()); } } } }
From source file:org.pentaho.platform.uifoundation.chart.JFreeChartEngine.java
private static void updatePlot(final Plot plot, final ChartDefinition chartDefinition) { plot.setBackgroundPaint(chartDefinition.getPlotBackgroundPaint()); plot.setBackgroundImage(chartDefinition.getPlotBackgroundImage()); plot.setNoDataMessage(chartDefinition.getNoDataMessage()); // create a custom palette if it was defined if (chartDefinition.getPaintSequence() != null) { DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(chartDefinition.getPaintSequence(), DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE); plot.setDrawingSupplier(drawingSupplier); }// w ww . j av a 2s . c o m plot.setOutlineStroke(null); // TODO define outline stroke if (plot instanceof CategoryPlot) { CategoryPlot categoryPlot = (CategoryPlot) plot; CategoryDatasetChartDefinition categoryDatasetChartDefintion = (CategoryDatasetChartDefinition) chartDefinition; categoryPlot.setOrientation(categoryDatasetChartDefintion.getOrientation()); CategoryAxis domainAxis = categoryPlot.getDomainAxis(); if (domainAxis != null) { domainAxis.setLabel(categoryDatasetChartDefintion.getDomainTitle()); domainAxis.setLabelFont(categoryDatasetChartDefintion.getDomainTitleFont()); if (categoryDatasetChartDefintion.getDomainTickFont() != null) { domainAxis.setTickLabelFont(categoryDatasetChartDefintion.getDomainTickFont()); } domainAxis.setCategoryLabelPositions(categoryDatasetChartDefintion.getCategoryLabelPositions()); } NumberAxis numberAxis = (NumberAxis) categoryPlot.getRangeAxis(); if (numberAxis != null) { numberAxis.setLabel(categoryDatasetChartDefintion.getRangeTitle()); numberAxis.setLabelFont(categoryDatasetChartDefintion.getRangeTitleFont()); if (categoryDatasetChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { numberAxis.setLowerBound(categoryDatasetChartDefintion.getRangeMinimum()); } if (categoryDatasetChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { numberAxis.setUpperBound(categoryDatasetChartDefintion.getRangeMaximum()); } if (categoryDatasetChartDefintion.getRangeTickFormat() != null) { numberAxis.setNumberFormatOverride(categoryDatasetChartDefintion.getRangeTickFormat()); } if (categoryDatasetChartDefintion.getRangeTickFont() != null) { numberAxis.setTickLabelFont(categoryDatasetChartDefintion.getRangeTickFont()); } if (categoryDatasetChartDefintion.getRangeTickUnits() != null) { numberAxis.setTickUnit(new NumberTickUnit(categoryDatasetChartDefintion.getRangeTickUnits())); } } } if (plot instanceof PiePlot) { PiePlot pie = (PiePlot) plot; PieDatasetChartDefinition pieDefinition = (PieDatasetChartDefinition) chartDefinition; pie.setInteriorGap(pieDefinition.getInteriorGap()); pie.setStartAngle(pieDefinition.getStartAngle()); pie.setLabelFont(pieDefinition.getLabelFont()); if (pieDefinition.getLabelPaint() != null) { pie.setLabelPaint(pieDefinition.getLabelPaint()); } pie.setLabelBackgroundPaint(pieDefinition.getLabelBackgroundPaint()); if (pieDefinition.isLegendIncluded()) { StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator("{0}"); //$NON-NLS-1$ pie.setLegendLabelGenerator(labelGen); } if (pieDefinition.getExplodedSlices() != null) { for (Iterator iter = pieDefinition.getExplodedSlices().iterator(); iter.hasNext();) { pie.setExplodePercent((Comparable) iter.next(), .30); } } pie.setLabelGap(pieDefinition.getLabelGap()); if (!pieDefinition.isDisplayLabels()) { pie.setLabelGenerator(null); } else { if (pieDefinition.isLegendIncluded()) { StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator("{1} ({2})"); //$NON-NLS-1$ pie.setLabelGenerator(labelGen); } else { StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator( "{0} = {1} ({2})"); //$NON-NLS-1$ pie.setLabelGenerator(labelGen); } } } if (plot instanceof MultiplePiePlot) { MultiplePiePlot pies = (MultiplePiePlot) plot; CategoryDatasetChartDefinition categoryDatasetChartDefintion = (CategoryDatasetChartDefinition) chartDefinition; pies.setDataset(categoryDatasetChartDefintion); } if (plot instanceof MeterPlot) { MeterPlot meter = (MeterPlot) plot; DialWidgetDefinition widget = (DialWidgetDefinition) chartDefinition; List intervals = widget.getIntervals(); Iterator intervalIterator = intervals.iterator(); while (intervalIterator.hasNext()) { MeterInterval interval = (MeterInterval) intervalIterator.next(); meter.addInterval(interval); } meter.setNeedlePaint(widget.getNeedlePaint()); meter.setDialShape(widget.getDialShape()); meter.setDialBackgroundPaint(widget.getPlotBackgroundPaint()); meter.setRange(new Range(widget.getMinimum(), widget.getMaximum())); } if (plot instanceof XYPlot) { XYPlot xyPlot = (XYPlot) plot; if (chartDefinition instanceof XYSeriesCollectionChartDefinition) { XYSeriesCollectionChartDefinition xySeriesCollectionChartDefintion = (XYSeriesCollectionChartDefinition) chartDefinition; xyPlot.setOrientation(xySeriesCollectionChartDefintion.getOrientation()); ValueAxis domainAxis = xyPlot.getDomainAxis(); if (domainAxis != null) { domainAxis.setLabel(xySeriesCollectionChartDefintion.getDomainTitle()); domainAxis.setLabelFont(xySeriesCollectionChartDefintion.getDomainTitleFont()); domainAxis.setVerticalTickLabels(xySeriesCollectionChartDefintion.isDomainVerticalTickLabels()); if (xySeriesCollectionChartDefintion.getDomainTickFormat() != null) { ((NumberAxis) domainAxis) .setNumberFormatOverride(xySeriesCollectionChartDefintion.getDomainTickFormat()); } if (xySeriesCollectionChartDefintion.getDomainTickFont() != null) { domainAxis.setTickLabelFont(xySeriesCollectionChartDefintion.getDomainTickFont()); } if (xySeriesCollectionChartDefintion.getDomainMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { domainAxis.setLowerBound(xySeriesCollectionChartDefintion.getDomainMinimum()); } if (xySeriesCollectionChartDefintion.getDomainMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { domainAxis.setUpperBound(xySeriesCollectionChartDefintion.getDomainMaximum()); } } ValueAxis rangeAxis = xyPlot.getRangeAxis(); if (rangeAxis != null) { rangeAxis.setLabel(xySeriesCollectionChartDefintion.getRangeTitle()); rangeAxis.setLabelFont(xySeriesCollectionChartDefintion.getRangeTitleFont()); if (xySeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { rangeAxis.setLowerBound(xySeriesCollectionChartDefintion.getRangeMinimum()); } if (xySeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { rangeAxis.setUpperBound(xySeriesCollectionChartDefintion.getRangeMaximum()); } if (xySeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { rangeAxis.setLowerBound(xySeriesCollectionChartDefintion.getRangeMinimum()); } if (xySeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { rangeAxis.setUpperBound(xySeriesCollectionChartDefintion.getRangeMaximum()); } if (xySeriesCollectionChartDefintion.getRangeTickFormat() != null) { ((NumberAxis) rangeAxis) .setNumberFormatOverride(xySeriesCollectionChartDefintion.getRangeTickFormat()); } if (xySeriesCollectionChartDefintion.getRangeTickFont() != null) { rangeAxis.setTickLabelFont(xySeriesCollectionChartDefintion.getRangeTickFont()); } } } else if (chartDefinition instanceof TimeSeriesCollectionChartDefinition) { TimeSeriesCollectionChartDefinition timeSeriesCollectionChartDefintion = (TimeSeriesCollectionChartDefinition) chartDefinition; xyPlot.setOrientation(timeSeriesCollectionChartDefintion.getOrientation()); ValueAxis domainAxis = xyPlot.getDomainAxis(); if (domainAxis != null) { domainAxis.setLabel(timeSeriesCollectionChartDefintion.getDomainTitle()); domainAxis.setLabelFont(timeSeriesCollectionChartDefintion.getDomainTitleFont()); domainAxis .setVerticalTickLabels(timeSeriesCollectionChartDefintion.isDomainVerticalTickLabels()); if (domainAxis instanceof DateAxis) { DateAxis da = (DateAxis) domainAxis; if (timeSeriesCollectionChartDefintion.getDateMinimum() != null) { da.setMinimumDate(timeSeriesCollectionChartDefintion.getDateMinimum()); } if (timeSeriesCollectionChartDefintion.getDateMaximum() != null) { da.setMaximumDate(timeSeriesCollectionChartDefintion.getDateMaximum()); } } } ValueAxis rangeAxis = xyPlot.getRangeAxis(); if (rangeAxis != null) { rangeAxis.setLabel(timeSeriesCollectionChartDefintion.getRangeTitle()); rangeAxis.setLabelFont(timeSeriesCollectionChartDefintion.getRangeTitleFont()); if (timeSeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { rangeAxis.setLowerBound(timeSeriesCollectionChartDefintion.getRangeMinimum()); } if (timeSeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { rangeAxis.setUpperBound(timeSeriesCollectionChartDefintion.getRangeMaximum()); } } } else if (chartDefinition instanceof XYZSeriesCollectionChartDefinition) { XYZSeriesCollectionChartDefinition xyzSeriesCollectionChartDefintion = (XYZSeriesCollectionChartDefinition) chartDefinition; xyPlot.setOrientation(xyzSeriesCollectionChartDefintion.getOrientation()); ValueAxis domainAxis = xyPlot.getDomainAxis(); if (domainAxis != null) { domainAxis.setLabel(xyzSeriesCollectionChartDefintion.getDomainTitle()); domainAxis.setLabelFont(xyzSeriesCollectionChartDefintion.getDomainTitleFont()); domainAxis .setVerticalTickLabels(xyzSeriesCollectionChartDefintion.isDomainVerticalTickLabels()); if (xyzSeriesCollectionChartDefintion.getDomainMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { domainAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getDomainMinimum()); } if (xyzSeriesCollectionChartDefintion.getDomainMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { domainAxis.setUpperBound(xyzSeriesCollectionChartDefintion.getDomainMaximum()); } if (xyzSeriesCollectionChartDefintion.getDomainTickFormat() != null) { ((NumberAxis) domainAxis) .setNumberFormatOverride(xyzSeriesCollectionChartDefintion.getDomainTickFormat()); } if (xyzSeriesCollectionChartDefintion.getDomainTickFont() != null) { domainAxis.setTickLabelFont(xyzSeriesCollectionChartDefintion.getDomainTickFont()); } } ValueAxis rangeAxis = xyPlot.getRangeAxis(); if (rangeAxis != null) { rangeAxis.setLabel(xyzSeriesCollectionChartDefintion.getRangeTitle()); rangeAxis.setLabelFont(xyzSeriesCollectionChartDefintion.getRangeTitleFont()); rangeAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getRangeMinimum()); if (xyzSeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) { rangeAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getRangeMinimum()); } if (xyzSeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) { rangeAxis.setUpperBound(xyzSeriesCollectionChartDefintion.getRangeMaximum()); } if (xyzSeriesCollectionChartDefintion.getRangeTickFormat() != null) { ((NumberAxis) rangeAxis) .setNumberFormatOverride(xyzSeriesCollectionChartDefintion.getRangeTickFormat()); } if (xyzSeriesCollectionChartDefintion.getRangeTickFont() != null) { rangeAxis.setTickLabelFont(xyzSeriesCollectionChartDefintion.getRangeTickFont()); } } } } }
From source file:net.sf.fspdfs.chartthemes.simple.SimpleChartTheme.java
/** * *//*w w w . j av a2 s. co m*/ protected void configurePlot(Plot plot, JRChartPlot jrPlot) { RectangleInsets padding = getPlotSettings().getPadding(); if (padding != null) plot.setInsets(padding); Boolean plotOutlineVisible = getPlotSettings().getOutlineVisible(); if (plotOutlineVisible == null || plotOutlineVisible.booleanValue()) { Paint outlinePaint = getPlotSettings().getOutlinePaint() == null ? null : getPlotSettings().getOutlinePaint().getPaint(); if (outlinePaint != null) plot.setOutlinePaint(outlinePaint); Stroke plotOutlineStroke = getPlotSettings().getOutlineStroke(); if (plotOutlineStroke != null) plot.setOutlineStroke(plotOutlineStroke); plot.setOutlineVisible(true); } else { plot.setOutlineVisible(false); } setPlotBackground(plot, jrPlot); setPlotDrawingDefaults(plot, jrPlot); if (plot instanceof CategoryPlot) { handleCategoryPlotSettings((CategoryPlot) plot, jrPlot); } if (plot instanceof XYPlot) { handleXYPlotSettings((XYPlot) plot, jrPlot); } }