Package net.sf.jasperreports.charts.fill
Class DefaultChartTheme
java.lang.Object
net.sf.jasperreports.charts.fill.DefaultChartTheme
- All Implemented Interfaces:
ChartTheme
- Author:
- Teodor Danciu (teodord@users.sourceforge.net), Some enhancements by Barry Klawans (bklawans@users.sourceforge.net)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
calculateTickUnits
(org.jfree.chart.axis.Axis axis, boolean isRangeAxis) For a given axis, adjust the tick unit size, in order to have a customizable number of ticks on that axisprotected void
configureAxis
(org.jfree.chart.axis.Axis axis, JRFont labelFont, Color labelColor, JRFont tickLabelFont, Color tickLabelColor, String tickLabelMask, Boolean verticalTickLabels, Color lineColor, boolean isRangeAxis, Comparable<?> axisMinValue, Comparable<?> axisMaxValue) Sets all the axis formatting options.protected void
configureChart
(org.jfree.chart.JFreeChart jfreeChart) protected void
configurePlot
(org.jfree.chart.plot.Plot plot) protected org.jfree.chart.plot.MeterInterval
convertInterval
(JRMeterInterval interval) Converts a JasperReports meter interval to one that JFreeChart understands.protected org.jfree.data.Range
convertRange
(JRDataRange dataRange) Converts a JasperReport data range into one understood by JFreeChart.protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
Deprecated.To be removed.protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
org.jfree.chart.JFreeChart
createChart
(ChartContext chartContext) protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
Deprecated.To be removedprotected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
Deprecated.To be removedprotected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
Build and run a thermometer chart.protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected org.jfree.chart.JFreeChart
protected final Object
evaluateExpression
(JRExpression expression) protected final String
evaluateTextExpression
(JRExpression expression) protected JRChart
getChart()
protected org.jfree.chart.axis.AxisLocation
getChartAxisLocation
(JRChartAxis chartAxis) Specifies the axis location.protected org.jfree.data.general.Dataset
protected JRFont
protected Object
protected Locale
protected JRChartPlot
getPlot()
protected boolean
Specifies whether a chart legend should be visible or no by default.protected void
setAxisBounds
(org.jfree.chart.axis.Axis axis, boolean isRangeAxis, Comparable<?> axisMinValue, Comparable<?> axisMaxValue)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_CHART_TYPE
- See Also:
-
PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE
- See Also:
-
PROPERTY_DIAL_LABEL
- See Also:
-
PROPERTY_RANGE_AXIS_TICK_COUNT
- See Also:
-
PROPERTY_RANGE_AXIS_TICK_INTERVAL
- See Also:
-
PROPERTY_RANGE_AXIS_INTEGER_UNIT
- See Also:
-
PROPERTY_DOMAIN_AXIS_TICK_COUNT
- See Also:
-
PROPERTY_DOMAIN_AXIS_TICK_INTERVAL
- See Also:
-
PROPERTY_DOMAIN_AXIS_INTEGER_UNIT
- See Also:
-
TRANSPARENT_PAINT
-
BUNDLE
-
-
Constructor Details
-
DefaultChartTheme
public DefaultChartTheme()
-
-
Method Details
-
getChart
-
getPlot
-
getDataset
protected org.jfree.data.general.Dataset getDataset() -
getLabelGenerator
-
getLocale
-
getFont
-
evaluateTextExpression
- Throws:
JRException
-
evaluateExpression
- Throws:
JRException
-
createChart
- Specified by:
createChart
in interfaceChartTheme
- Returns:
- an
org.jfree.chart.JFreeChart
object representing the chart - Throws:
JRException
-
configureChart
- Throws:
JRException
-
configurePlot
protected void configurePlot(org.jfree.chart.plot.Plot plot) -
configureAxis
protected void configureAxis(org.jfree.chart.axis.Axis axis, JRFont labelFont, Color labelColor, JRFont tickLabelFont, Color tickLabelColor, String tickLabelMask, Boolean verticalTickLabels, Color lineColor, boolean isRangeAxis, Comparable<?> axisMinValue, 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 formatlabelFont
- the font to use for the axis labellabelColor
- the color of the axis labeltickLabelFont
- the font to use for each tick mark value labeltickLabelColor
- the color of each tick mark value labeltickLabelMask
- formatting mask for the label. If the axis is a NumberAxis then the mask should bejava.text.DecimalFormat
mask, and if it is a DateAxis then the mask should be ajava.text.SimpleDateFormat
mask.verticalTickLabels
- flag to draw tick labels at 90 degreeslineColor
- color to use when drawing the axis line and any tick marks
-
createAreaChart
- Throws:
JRException
-
createBar3DChart
Deprecated.To be removed.- Throws:
JRException
-
createBarChart
- Throws:
JRException
-
createBubbleChart
- Throws:
JRException
-
createCandlestickChart
- Throws:
JRException
-
createHighLowChart
- Throws:
JRException
-
createLineChart
- Throws:
JRException
-
createPie3DChart
Deprecated.To be removed- Throws:
JRException
-
createPieChart
- Throws:
JRException
-
createScatterChart
- Throws:
JRException
-
createStackedBar3DChart
Deprecated.To be removed- Throws:
JRException
-
createStackedBarChart
- Throws:
JRException
-
createStackedAreaChart
- Throws:
JRException
-
createXyAreaChart
- Throws:
JRException
-
createXYBarChart
- Throws:
JRException
-
createXyLineChart
- Throws:
JRException
-
createTimeSeriesChart
- Throws:
JRException
-
createGanttChart
- Throws:
JRException
-
convertRange
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 org.jfree.chart.plot.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
- Throws:
JRException
-
createThermometerChart
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
- Throws:
JRException
-
getChartAxisLocation
Specifies the axis location. It has to be overridden for child themes with another default axis location -
setAxisBounds
protected void setAxisBounds(org.jfree.chart.axis.Axis axis, boolean isRangeAxis, Comparable<?> axisMinValue, Comparable<?> axisMaxValue) -
calculateTickUnits
protected void calculateTickUnits(org.jfree.chart.axis.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
-