|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Plot | +--com.jrefinery.chart.CategoryPlot | +--com.jrefinery.chart.HorizontalCategoryPlot
A class that plots data from a CategoryDataset, with the values plotted along the horizontal axis and the categories plotted along the vertical axis. A plug-in class that implements the CategoryItemRenderer class is used to draw individual data items.
CategoryPlot
,
CategoryItemRenderer
Fields inherited from class com.jrefinery.chart.CategoryPlot |
categoryGapsPercent, domainAxis, introGapPercent, itemGapsPercent, labelFont, labelFormatPattern, labelFormatter, labelPaint, parent, rangeAxis, rangeMarkers, renderer, trailGapPercent, valueLabelsVisible, verticalLabels |
Fields inherited from interface com.jrefinery.chart.CategoryPlotConstants |
DEFAULT_CATEGORY_GAPS_PERCENT, DEFAULT_INTRO_GAP_PERCENT, DEFAULT_ITEM_GAPS_PERCENT, DEFAULT_LABEL_FONT, DEFAULT_TRAIL_GAP_PERCENT, MAX_CATEGORY_GAPS_PERCENT, MAX_INTRO_GAP_PERCENT, MAX_ITEM_GAPS_PERCENT, MAX_TRAIL_GAP_PERCENT |
Fields inherited from interface com.jrefinery.chart.AxisConstants |
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_PAINT, DEFAULT_TICK_STROKE |
Constructor Summary | |
HorizontalCategoryPlot(CategoryDataset data,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryItemRenderer renderer)
Constructs a horizontal category plot. |
|
HorizontalCategoryPlot(CategoryDataset data,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryItemRenderer renderer,
java.awt.Insets insets,
java.awt.Paint backgroundPaint,
java.awt.Image backgroundImage,
float backgroundAlpha,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint,
float alpha,
double introGapPercent,
double trailGapPercent,
double categoryGapPercent,
double itemGapPercent)
Constructs a horizontal category plot. |
Method Summary | |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
double |
getCategoryCoordinate(int category,
java.awt.geom.Rectangle2D area)
Returns the x-coordinate (in Java 2D User Space) of the center of the specified category. |
CategoryDataset |
getCategoryDataset()
A convenience method that returns the dataset for the plot, cast as a CategoryDataset. |
Range |
getHorizontalDataRange()
Returns the data range for the horizontal axis. |
ValueAxis |
getHorizontalValueAxis()
Returns the horizontal axis. |
java.lang.String |
getPlotType()
Returns a short string describing the type of plot. |
void |
handleClick(int x,
int y,
ChartRenderingInfo info)
Handles a 'click' on the plot by updating the anchor values... |
boolean |
isCompatibleDomainAxis(CategoryAxis axis)
Checks the compatibility of a domain axis, returning true if the axis is compatible with the plot, and false otherwise. |
boolean |
isCompatibleHorizontalAxis(Axis axis)
Checks the compatibility of a horizontal axis, returning true if the axis is compatible with the plot, and false otherwise. |
boolean |
isCompatibleRangeAxis(ValueAxis axis)
Checks the compatibility of a range axis, returning true if the axis is compatible with the plot, and false otherwise. |
boolean |
isCompatibleVerticalAxis(Axis axis)
Checks the compatibility of a vertical axis, returning true if the axis is compatible with the plot, and false otherwise. |
void |
render(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
ChartRenderingInfo info,
java.awt.Shape backgroundPlotArea)
Draws a representation of the data within the dataArea region, using the current renderer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HorizontalCategoryPlot(CategoryDataset data, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)
data
- the dataset.domainAxis
- the domain axis.rangeAxis
- the range axis.renderer
- the renderer for the data.public HorizontalCategoryPlot(CategoryDataset data, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer, java.awt.Insets insets, java.awt.Paint backgroundPaint, java.awt.Image backgroundImage, float backgroundAlpha, java.awt.Stroke outlineStroke, java.awt.Paint outlinePaint, float alpha, double introGapPercent, double trailGapPercent, double categoryGapPercent, double itemGapPercent)
data
- the dataset.domainAxis
- the domain axis.rangeAxis
- the range axis.renderer
- the renderer for the plot.insets
- the amount of space to leave blank around the edges of the plot.backgroundPaint
- an optional color for the plot's background.backgroundImage
- an optional image for the plot's background.backgroundAlpha
- alpha-transparency for the plot's background.outlineStroke
- the Stroke used to draw an outline around the plot.outlinePaint
- the color used to draw an outline around the plot.alpha
- the alpha-transparency for the plot.introGapPercent
- the gap before the first bar in the plot.trailGapPercent
- the gap after the last bar in the plot.categoryGapPercent
- the gap between the last bar in one
category and the first bar in the next category.itemGapPercent
- the gap between bars within the same category.Method Detail |
public CategoryDataset getCategoryDataset()
getCategoryDataset
in class CategoryPlot
public double getCategoryCoordinate(int category, java.awt.geom.Rectangle2D area)
getCategoryCoordinate
in class CategoryPlot
category
- the category (zero-based index).area
- the region within which the plot will be drawn.public boolean isCompatibleHorizontalAxis(Axis axis)
axis
- The proposed horizontal axis.true
if the axis is compatible with the plot.public boolean isCompatibleVerticalAxis(Axis axis)
axis
- the vertical axis.true
if the axis is compatible with the plot.public boolean isCompatibleDomainAxis(CategoryAxis axis)
isCompatibleDomainAxis
in class CategoryPlot
axis
- the proposed axis.true
if the axis is compatible with the plot.public boolean isCompatibleRangeAxis(ValueAxis axis)
isCompatibleRangeAxis
in class CategoryPlot
axis
- the proposed axis.true
if the axis is compatible with the plot.public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, ChartRenderingInfo info)
At your option, you may supply an instance of ChartRenderingInfo. If you do, it will be populated with information about the drawing, including various plot dimensions and tooltip info.
draw
in class Plot
g2
- the graphics device.plotArea
- the area within which the plot should be drawn.info
- a structure for passing back information about the
chart drawing (ignored if null).public void render(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ChartRenderingInfo info, java.awt.Shape backgroundPlotArea)
g2
- the graphics device.dataArea
- the region in which the data is to be drawn.info
- an optional object for collection dimension information.backgroundPlotArea
- the chart's background area.public java.lang.String getPlotType()
getPlotType
in class Plot
public Range getHorizontalDataRange()
getHorizontalDataRange
in interface HorizontalValuePlot
public ValueAxis getHorizontalValueAxis()
This method supports the HorizontalValuePlot interface.
getHorizontalValueAxis
in interface HorizontalValuePlot
public void handleClick(int x, int y, ChartRenderingInfo info)
handleClick
in class Plot
x
- x-coordinate of the click.y
- y-coordinate of the click.info
- an optional info collection object to return data back to the caller.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |