|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jinsight.jetchart.Legend
The Legend class implements the legend box to display series titles. JetChart
supports an unlimited number of legend boxes, each of them associated with
different sets of series titles.
By default, all series titles are displayed in the primary legend box, which
always exists and is automatically created. A legend box manually created
is a secondary legend box. To display a series title inside a secondary
legend box, add the series using the method Legend.addSeries(AbstractSerie as),
as below:
LineSerie ls=new LineSerie();
ls.setTitle("Line series");
Legend legend=new Legend();
legend.addSerie(ls);
Any series not added to secondary legend boxes are automatically added to
the primary legend box.
Field Summary | |
static int |
ANYWHERE
Constant used to place the legend box at any location on the chart area. |
static int |
BOTTOM
Constant used to place the legend box at the bottom and centered. |
static int |
BOTTOM_LEFT
Constant used to place the legend box at the bottom and left-aligned. |
static int |
BOTTOM_RIGHT
Contant used to place the legend box at the bottom and right-aligned. |
static int |
HORIZONTAL
Constant used to arrange series titles horizontally. |
static int |
LEFT
Constant used to place the legend box at the left side. |
static int |
RIGHT
Constant used to place the legend box at the right side. |
static int |
VERTICAL
Constant used to arrange series titles vertically. |
Constructor Summary | |
Legend()
|
Method Summary | |
void |
addSerie(AbstractSerie as)
Adds a series to this legend box. |
protected void |
finalize()
|
int |
getPosition()
Returns the legend box position. |
void |
removeAllSeries()
Removes all series from this legend box. |
void |
removeSerie(AbstractSerie as)
Removes a series from this legend box. |
void |
setAutoOrientationEnabled(boolean isAutoOrientationEnabled)
Enables/disables automatic orientation. |
void |
setBackground(java.awt.Color background)
Sets the legend box background color. |
void |
setColumnGap(int columnGap)
Sets the gap between columns of a legend box. |
void |
setColumnLayout(int nrOfColumns)
Sets the number of columns in the legend box. |
void |
setEnabled(boolean isEnabled)
Enables/disables this Legend object. |
void |
setFont(java.awt.Font font)
Sets the legend box font. |
void |
setForeground(java.awt.Color foreground)
Sets the legend box foreground color. |
void |
setHGap(int hGap)
Sets horizontal gap. |
void |
setLocation(int x,
int y)
Sets the location of the legend box, in absolute coordinates. |
void |
setOpacityEnabled(boolean isOpaque)
Enables/disables opacity. |
void |
setOrientation(int orientation)
Sets the legend box orientation to horizontal or vertical. |
void |
setPosition(int position)
Sets the legend box position to the left, right, bottom or any location within the chart area. |
void |
setRowGap(int rowGap)
Sets the gap between rows in a legend box displaying multiple rows. |
void |
setVGap(int vGap)
Sets vertical gap. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VERTICAL
public static final int HORIZONTAL
public static final int LEFT
public static final int BOTTOM
public static final int RIGHT
public static final int BOTTOM_LEFT
public static final int BOTTOM_RIGHT
public static final int ANYWHERE
Constructor Detail |
public Legend()
Method Detail |
public void setEnabled(boolean isEnabled)
isEnabled
- A boolean value(true/false).public void addSerie(AbstractSerie as)
as
- An AbstractSerie object.removeSerie(com.jinsight.jetchart.AbstractSerie)
,
GenericGraph.addLegend(com.jinsight.jetchart.Legend)
,
GenericGraph.removeLegend(com.jinsight.jetchart.Legend)
public void removeSerie(AbstractSerie as)
as
- An AbstractSerie object.addSerie(com.jinsight.jetchart.AbstractSerie)
,
GenericGraph.addLegend(com.jinsight.jetchart.Legend)
,
GenericGraph.removeLegend(com.jinsight.jetchart.Legend)
public void removeAllSeries()
addSerie(com.jinsight.jetchart.AbstractSerie)
,
removeSerie(com.jinsight.jetchart.AbstractSerie)
,
GenericGraph.addLegend(com.jinsight.jetchart.Legend)
,
GenericGraph.removeLegend(com.jinsight.jetchart.Legend)
public void setFont(java.awt.Font font)
font
- A Font object.public void setColumnLayout(int nrOfColumns)
nrOfColumns
- An integer number.setOrientation(int)
public void setOrientation(int orientation)
orientation
- An integer number indicating legend box orientation.HORIZONTAL
,
VERTICAL
public void setAutoOrientationEnabled(boolean isAutoOrientationEnabled)
isAutoOrientationEnabled
- A boolean value.public void setPosition(int position)
position
- An integer number indicating the legend box position.LEFT
,
RIGHT
,
BOTTOM
,
BOTTOM_LEFT
,
BOTTOM_RIGHT
,
ANYWHERE
,
setAutoOrientationEnabled(boolean)
public void setLocation(int x, int y)
x
- The x coordinate of the upper left corner of the legend box.y
- The y coordinate of the upper left corner of the legend box.ANYWHERE
,
setPosition(int)
,
setAutoOrientationEnabled(boolean)
public int getPosition()
LEFT
,
RIGHT
,
BOTTOM
,
BOTTOM_RIGHT
,
BOTTOM_LEFT
,
ANYWHERE
public void setBackground(java.awt.Color background)
background
- A Color object.public void setOpacityEnabled(boolean isOpaque)
isOpaque
- A boolean value(true/false).public void setForeground(java.awt.Color foreground)
foreground
- A Color object.public void setHGap(int hGap)
hGap
- An integer number indicating the horizontal gap, in pixels.public void setVGap(int vGap)
vGap
- An integer number indicating the vertical gap, in pixels.public void setColumnGap(int columnGap)
columnGap
- an integer number equal or greater than zero.setColumnLayout(int)
,
setOrientation(int)
public void setRowGap(int rowGap)
rowGap
- An integer number.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |