public class IlvDataLabelAnnotation extends Object implements IlvDataAnnotation, Serializable
IlvChartRenderer.computeDataLabel(ilog.views.chart.data.IlvDataSetPoint)
method
to compute the displayed string if no explicit text has been set, and the
IlvChartRenderer.computeDataLabelLocation(ilog.views.chart.IlvDisplayPoint, java.awt.Dimension)
to
compute the label location.
Here is a picture showing a data label annotation set individually on a data point of a Pie chart:
Constructor and Description |
---|
IlvDataLabelAnnotation()
Creates a new label information using a default label renderer.
|
IlvDataLabelAnnotation(IlvLabelRenderer labelRenderer)
Creates a new label information using the specified label renderer.
|
Modifier and Type | Method and Description |
---|---|
protected Point |
computeLabelLocation(String label,
IlvDisplayPoint dp)
Returns the center of the label annotation.
|
protected String |
computeText(IlvDisplayPoint dp)
Computes the text displayed by the data annotation.
|
void |
draw(Graphics g,
IlvDisplayPoint dp)
Draws the annotation according to the specified display point.
|
Rectangle2D |
getBounds(IlvDisplayPoint dp,
Rectangle2D bounds)
Returns the bounding rectangle of this annotation,
when displayed according to the specified display point.
|
IlvLabelRenderer |
getLabelRenderer()
Returns the renderer used to display the label.
|
String |
getText()
Returns the text of this annotation.
|
void |
setLabelRenderer(IlvLabelRenderer labelRenderer)
Sets the renderer that displays the label.
|
void |
setText(String text)
Sets the text of this annotation.
|
public IlvDataLabelAnnotation()
public IlvDataLabelAnnotation(IlvLabelRenderer labelRenderer)
public String getText()
null
if no text has been set.setText(java.lang.String)
public void setText(String text)
computeText(ilog.views.chart.IlvDisplayPoint)
public final IlvLabelRenderer getLabelRenderer()
public void setLabelRenderer(IlvLabelRenderer labelRenderer)
public void draw(Graphics g, IlvDisplayPoint dp)
draw
in interface IlvDataAnnotation
public Rectangle2D getBounds(IlvDisplayPoint dp, Rectangle2D bounds)
getBounds
in interface IlvDataAnnotation
dp
- The considered display point.bounds
- A rectangle optionally used to store the result. If
null
, a new Rectangle2D
is allocated.protected String computeText(IlvDisplayPoint dp)
setText(java.lang.String)
, or if
null, calls the IlvChartRenderer.computeDataLabel(ilog.views.chart.data.IlvDataSetPoint)
method of the renderer displaying the specified display point.setText(java.lang.String)
protected Point computeLabelLocation(String label, IlvDisplayPoint dp)
IlvChartRenderer.computeDataLabelLocation(ilog.views.chart.IlvDisplayPoint, java.awt.Dimension)
method
of the renderer displaying the specified display point.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.