Class JRDesignMeterPlot
java.lang.Object
net.sf.jasperreports.charts.base.JRBaseChartPlot
net.sf.jasperreports.charts.base.JRBaseMeterPlot
net.sf.jasperreports.charts.design.JRDesignMeterPlot
- All Implemented Interfaces:
Serializable,Cloneable,JRChartPlot,JRMeterPlot,JRChangeEventsSupport,JRCloneable
A meter plot that displays a single value against a range of values. The
range can be further subdivided into multiple color coded regions.
- Author:
- Barry Klawans (bklawans@users.sourceforge.net)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
JRBaseChartPlot.JRBaseSeriesColorNested classes/interfaces inherited from interface net.sf.jasperreports.charts.JRChartPlot
JRChartPlot.JRSeriesColor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class net.sf.jasperreports.charts.base.JRBaseMeterPlot
dataRange, intervals, meterAngle, meterBackgroundColor, needleColor, shape, tickColor, tickCount, tickInterval, tickLabelFont, units, valueDisplayFields inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
backcolor, backgroundAlpha, chart, foregroundAlpha, labelRotation, orientation, PROPERTY_BACKCOLOR, PROPERTY_BACKGROUND_ALPHA, PROPERTY_FOREGROUND_ALPHA, PROPERTY_LABEL_ROTATION, PROPERTY_ORIENTATION, PROPERTY_SERIES_COLORS, seriesColors -
Constructor Summary
ConstructorsConstructorDescriptionJRDesignMeterPlot(JRChartPlot plot, JRChart chart) Construct a new meter plot by copying an existing one. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterval(JRMeterInterval interval) Adds an interval to the meter.voidRemoves all the intervals for the meter.voidsetDataRange(JRDataRange dataRange) Sets the range of values that the meter can display.voidsetIntervals(Collection<JRMeterInterval> intervals) Sets the meter intervals.voidsetMeterAngle(Integer meterAngle) Sets the size of the meter face in degrees.voidsetMeterBackgroundColor(Color meterBackgroundColor) Sets the color to use for the meter face.voidsetNeedleColor(Color needleColor) Sets the color to use for the meter pointer.voidsetShape(MeterShapeEnum shape) Sets the shape of the meter.voidsetTickColor(Color tickColor) Sets the color to use when drawing tick marks on the meter.voidsetTickCount(Integer tickCount) Sets the number of major tick marks on the meter scale.voidsetTickInterval(Double tickInterval) Sets the space between tick marks on the face of the meter.voidsetTickLabelFont(JRFont tickLabelFont) Sets the font to use when displaying the tick label.voidSets the units string to use.voidsetValueDisplay(JRValueDisplay valueDisplay) Sets the value display formatting options.Methods inherited from class net.sf.jasperreports.charts.base.JRBaseMeterPlot
clone, collectExpressions, getDataRange, getIntervals, getMeterAngle, getMeterBackgroundColor, getNeedleColor, getShape, getTickColor, getTickCount, getTickInterval, getTickLabelFont, getUnits, getValueDisplayMethods inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
addSeriesColor, clearSeriesColors, clone, getBackcolor, getBackgroundAlpha, getChart, getEventSupport, getForegroundAlpha, getLabelRotation, getOrientation, getOwnBackcolor, getSeriesColors, getStyleResolver, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setSeriesColorsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.jasperreports.charts.JRChartPlot
addSeriesColor, clearSeriesColors, getBackcolor, getBackgroundAlpha, getChart, getForegroundAlpha, getLabelRotation, getOrientation, getOwnBackcolor, getSeriesColors, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setSeriesColorsMethods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
-
Field Details
-
PROPERTY_DATA_RANGE
- See Also:
-
PROPERTY_METER_ANGLE
- See Also:
-
PROPERTY_METER_BACKGROUND_COLOR
- See Also:
-
PROPERTY_NEEDLE_COLOR
- See Also:
-
PROPERTY_SHAPE
- See Also:
-
PROPERTY_TICK_COLOR
- See Also:
-
PROPERTY_TICK_COUNT
- See Also:
-
PROPERTY_TICK_INTERVAL
- See Also:
-
PROPERTY_UNITS
- See Also:
-
PROPERTY_VALUE_DISPLAY
- See Also:
-
PROPERTY_INTERVALS
- See Also:
-
PROPERTY_TICK_LABEL_FONT
- See Also:
-
-
Constructor Details
-
JRDesignMeterPlot
Construct a new meter plot by copying an existing one.- Parameters:
plot- the plot to copy
-
-
Method Details
-
setDataRange
Sets the range of values that the meter can display. Before changing this for an existing meter you should clear any existing intervals to ensure that you don't end up with intervals that are outside of the new range.- Parameters:
dataRange- the range of values that the meter can display- Throws:
JRException
-
setValueDisplay
Sets the value display formatting options.- Parameters:
valueDisplay- how to show the textual representation of the value
-
setShape
Sets the shape of the meter.- Parameters:
shape- the shape of the meter- Throws:
JRException- invalid shape was specified
-
addInterval
Adds an interval to the meter. An interval is used to indicate a section of the meter.- Parameters:
interval- the interval to add to the meter
-
clearIntervals
public void clearIntervals()Removes all the intervals for the meter. -
setIntervals
Sets the meter intervals.- Parameters:
intervals- the list of meter intervals (JRMeterIntervalinstances)- See Also:
-
setMeterAngle
Sets the size of the meter face in degrees.- Parameters:
meterAngle- the size of the meter in degrees
-
setUnits
Sets the units string to use. This string is appended to the value when it is displayed.- Parameters:
units- the units string to use
-
setTickInterval
Sets the space between tick marks on the face of the meter. The spacing is relative to the range of the meter. If the meter is displaying the range 100 to 200 and the tick interval is 20, four tick marks will be shown, one each at 120, 140, 160 and 180.- Parameters:
tickInterval- the space between tick marks on the meter
-
setMeterBackgroundColor
Sets the color to use for the meter face.- Parameters:
meterBackgroundColor- the color to use for the meter face
-
setNeedleColor
Sets the color to use for the meter pointer.- Parameters:
needleColor- the color to use for the meter pointer
-
setTickColor
Sets the color to use when drawing tick marks on the meter.- Parameters:
tickColor- the color to use when drawing tick marks
-
setTickCount
Sets the number of major tick marks on the meter scale.- Parameters:
tickCount- the number of major tick marks
-
setTickLabelFont
Sets the font to use when displaying the tick label.- Parameters:
tickLabelFont- the font to use when displaying the tick label
-