net.sf.jasperreports.engine.fill
Class DefaultChartTheme

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.DefaultChartTheme
All Implemented Interfaces:
ChartTheme

public class DefaultChartTheme
extends java.lang.Object
implements ChartTheme

Version:
$Id: DefaultChartTheme.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net), Some enhancements by Barry Klawans (bklawans@users.sourceforge.net)

Field Summary
static ChartThemeBundle BUNDLE
           
static java.lang.String PROPERTY_DIAL_LABEL
           
static java.lang.String PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE
           
static java.lang.String PROPERTY_DOMAIN_AXIS_TICK_COUNT
           
static java.lang.String PROPERTY_DOMAIN_AXIS_TICK_INTERVAL
           
static java.lang.String PROPERTY_RANGE_AXIS_TICK_COUNT
           
static java.lang.String PROPERTY_RANGE_AXIS_TICK_INTERVAL
           
protected static java.awt.Color TRANSPARENT_PAINT
           
 
Constructor Summary
DefaultChartTheme()
           
 
Method Summary
protected  void calculateTickUnits(Axis axis, boolean isRangeAxis)
          For a given axis, adjust the tick unit size, in order to have a customizable number of ticks on that axis
protected  void configureAxis(Axis axis, JRFont labelFont, java.awt.Color labelColor, JRFont tickLabelFont, java.awt.Color tickLabelColor, java.lang.String tickLabelMask, java.lang.Boolean verticalTickLabels, java.awt.Color lineColor, boolean isRangeAxis, java.lang.Comparable<?> axisMinValue, java.lang.Comparable<?> axisMaxValue)
          Sets all the axis formatting options.
protected  void configureChart(JFreeChart jfreeChart)
           
protected  void configurePlot(Plot plot)
           
protected  MeterInterval convertInterval(JRMeterInterval interval)
          Converts a JasperReports meter interval to one that JFreeChart understands.
protected  Range convertRange(JRDataRange dataRange)
          Converts a JasperReport data range into one understood by JFreeChart.
protected  JFreeChart createAreaChart()
           
protected  JFreeChart createBar3DChart()
           
protected  JFreeChart createBarChart()
           
protected  JFreeChart createBubbleChart()
           
protected  JFreeChart createCandlestickChart()
           
 JFreeChart createChart(ChartContext chartContext)
           
protected  JFreeChart createDialChart()
           
protected  JFreeChart createGanttChart()
           
protected  JFreeChart createHighLowChart()
           
protected  JFreeChart createLineChart()
           
protected  JFreeChart createMeterChart()
           
protected  JFreeChart createPie3DChart()
           
protected  JFreeChart createPieChart()
           
protected  JFreeChart createScatterChart()
           
protected  JFreeChart createStackedAreaChart()
           
protected  JFreeChart createStackedBar3DChart()
           
protected  JFreeChart createStackedBarChart()
           
protected  JFreeChart createThermometerChart()
          Build and run a thermometer chart.
protected  JFreeChart createTimeSeriesChart()
           
protected  JFreeChart createXyAreaChart()
           
protected  JFreeChart createXYBarChart()
           
protected  JFreeChart createXyLineChart()
           
protected  java.lang.Object evaluateExpression(JRExpression expression)
           
protected  java.lang.String evaluateTextExpression(JRExpression expression)
           
protected  JRChart getChart()
           
protected  AxisLocation getChartAxisLocation(JRChartAxis chartAxis)
          Specifies the axis location.
protected  Dataset getDataset()
           
protected  JRFont getFont(JRFont font)
           
protected  java.lang.Object getLabelGenerator()
           
protected  java.util.Locale getLocale()
           
protected  JRChartPlot getPlot()
           
protected  boolean isShowLegend()
          Specifies whether a chart legend should be visible or no by default.
protected  void setAxisBounds(Axis axis, boolean isRangeAxis, java.lang.Comparable<?> axisMinValue, java.lang.Comparable<?> axisMaxValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE

public static final java.lang.String PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE
See Also:
Constant Field Values

PROPERTY_DIAL_LABEL

public static final java.lang.String PROPERTY_DIAL_LABEL
See Also:
Constant Field Values

PROPERTY_RANGE_AXIS_TICK_COUNT

public static final java.lang.String PROPERTY_RANGE_AXIS_TICK_COUNT
See Also:
Constant Field Values

PROPERTY_RANGE_AXIS_TICK_INTERVAL

public static final java.lang.String PROPERTY_RANGE_AXIS_TICK_INTERVAL
See Also:
Constant Field Values

PROPERTY_DOMAIN_AXIS_TICK_COUNT

public static final java.lang.String PROPERTY_DOMAIN_AXIS_TICK_COUNT
See Also:
Constant Field Values

PROPERTY_DOMAIN_AXIS_TICK_INTERVAL

public static final java.lang.String PROPERTY_DOMAIN_AXIS_TICK_INTERVAL
See Also:
Constant Field Values

TRANSPARENT_PAINT

protected static final java.awt.Color TRANSPARENT_PAINT

BUNDLE

public static final ChartThemeBundle BUNDLE
Constructor Detail

DefaultChartTheme

public DefaultChartTheme()
Method Detail

getChart

protected JRChart getChart()

getPlot

protected JRChartPlot getPlot()

getDataset

protected Dataset getDataset()

getLabelGenerator

protected java.lang.Object getLabelGenerator()

getLocale

protected java.util.Locale getLocale()

getFont

protected JRFont getFont(JRFont font)

evaluateTextExpression

protected final java.lang.String evaluateTextExpression(JRExpression expression)
                                                 throws JRException
Throws:
JRException

evaluateExpression

protected final java.lang.Object evaluateExpression(JRExpression expression)
                                             throws JRException
Throws:
JRException

createChart

public JFreeChart createChart(ChartContext chartContext)
                       throws JRException
Specified by:
createChart in interface ChartTheme
Throws:
JRException

configureChart

protected void configureChart(JFreeChart jfreeChart)
                       throws JRException
Throws:
JRException

configurePlot

protected void configurePlot(Plot plot)

configureAxis

protected void configureAxis(Axis axis,
                             JRFont labelFont,
                             java.awt.Color labelColor,
                             JRFont tickLabelFont,
                             java.awt.Color tickLabelColor,
                             java.lang.String tickLabelMask,
                             java.lang.Boolean verticalTickLabels,
                             java.awt.Color lineColor,
                             boolean isRangeAxis,
                             java.lang.Comparable<?> axisMinValue,
                             java.lang.Comparable<?> axisMaxValue)
Sets all the axis formatting options. This includes the colors and fonts to use on the axis as well as the color to use when drawing the axis line.

Parameters:
axis - the axis to format
labelFont - the font to use for the axis label
labelColor - the color of the axis label
tickLabelFont - the font to use for each tick mark value label
tickLabelColor - the color of each tick mark value label
tickLabelMask - formatting mask for the label. If the axis is a NumberAxis then the mask should be java.text.DecimalFormat mask, and if it is a DateAxis then the mask should be a java.text.SimpleDateFormat mask.
verticalTickLabels - flag to draw tick labels at 90 degrees
lineColor - color to use when drawing the axis line and any tick marks

createAreaChart

protected JFreeChart createAreaChart()
                              throws JRException
Throws:
JRException

createBar3DChart

protected JFreeChart createBar3DChart()
                               throws JRException
Throws:
JRException

createBarChart

protected JFreeChart createBarChart()
                             throws JRException
Throws:
JRException

createBubbleChart

protected JFreeChart createBubbleChart()
                                throws JRException
Throws:
JRException

createCandlestickChart

protected JFreeChart createCandlestickChart()
                                     throws JRException
Throws:
JRException

createHighLowChart

protected JFreeChart createHighLowChart()
                                 throws JRException
Throws:
JRException

createLineChart

protected JFreeChart createLineChart()
                              throws JRException
Throws:
JRException

createPie3DChart

protected JFreeChart createPie3DChart()
                               throws JRException
Throws:
JRException

createPieChart

protected JFreeChart createPieChart()
                             throws JRException
Throws:
JRException

createScatterChart

protected JFreeChart createScatterChart()
                                 throws JRException
Throws:
JRException

createStackedBar3DChart

protected JFreeChart createStackedBar3DChart()
                                      throws JRException
Throws:
JRException

createStackedBarChart

protected JFreeChart createStackedBarChart()
                                    throws JRException
Throws:
JRException

createStackedAreaChart

protected JFreeChart createStackedAreaChart()
                                     throws JRException
Throws:
JRException

createXyAreaChart

protected JFreeChart createXyAreaChart()
                                throws JRException
Throws:
JRException

createXYBarChart

protected JFreeChart createXYBarChart()
                               throws JRException
Throws:
JRException

createXyLineChart

protected JFreeChart createXyLineChart()
                                throws JRException
Throws:
JRException

createTimeSeriesChart

protected JFreeChart createTimeSeriesChart()
                                    throws JRException
Throws:
JRException

createGanttChart

protected JFreeChart createGanttChart()
                               throws JRException
Throws:
JRException

convertRange

protected Range convertRange(JRDataRange dataRange)
                      throws JRException
Converts a JasperReport data range into one understood by JFreeChart.

Parameters:
dataRange - the JasperReport version of the range
Returns:
the JFreeChart version of the range
Throws:
JRException - thrown when the low value of the range is greater than the high value

convertInterval

protected MeterInterval convertInterval(JRMeterInterval interval)
                                 throws JRException
Converts a JasperReports meter interval to one that JFreeChart understands.

Parameters:
interval - the JasperReports definition of an interval
Returns:
the JFreeChart version of the same interval
Throws:
JRException - thrown when the interval contains an invalid range

createMeterChart

protected JFreeChart createMeterChart()
                               throws JRException
Throws:
JRException

createThermometerChart

protected JFreeChart createThermometerChart()
                                     throws JRException
Build and run a thermometer chart. JFreeChart thermometer charts have some limitations. They always have a maximum of three ranges, and the colors of those ranges seems to be fixed.

Throws:
JRException

createDialChart

protected JFreeChart createDialChart()
                              throws JRException
Throws:
JRException

getChartAxisLocation

protected AxisLocation getChartAxisLocation(JRChartAxis chartAxis)
Specifies the axis location. It has to be overridden for child themes with another default axis location


setAxisBounds

protected void setAxisBounds(Axis axis,
                             boolean isRangeAxis,
                             java.lang.Comparable<?> axisMinValue,
                             java.lang.Comparable<?> axisMaxValue)

calculateTickUnits

protected void calculateTickUnits(Axis axis,
                                  boolean isRangeAxis)
For a given axis, adjust the tick unit size, in order to have a customizable number of ticks on that axis


isShowLegend

protected boolean isShowLegend()
Specifies whether a chart legend should be visible or no by default. It has to be overridden for child themes which don't show chart legends



© 2001-2010 Jaspersoft Corporation www.jaspersoft.com