|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.rchart.ChartComponent | +--com.java4less.rchart.Legend
The legend contains the description of the data displayed in the chart. A legend can be displayed on the right side of the chart (default), at the top or at the bottom. The property Layout of the Chart modifies the behaviour. A legend is a list of pairs: LineStyle + Text: a line will be displayed next to the next. FillStle + Text: a small boy will be displayed nex to the text. Image + Text: the image will be displayed next to the text. Example: Legend l=new Legend(); l.border=new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.BLACK),LineStyle.LINE_NORMAL); l.addItem("Company A",GraphicsProvider.getColor(ChartColor.CYAN)); l.addItem("Company B",GraphicsProvider.getColor(ChartColor.GREEN)); the legend must be assigned to the chart: chart.legend=l;
Field Summary | |
FillStyle |
background
background of the legend. |
LineStyle |
border
border of the legend. |
ChartColor |
color
|
ChartFont |
font
|
java.lang.String |
legendLabel
use the legendLabel property to define the legend using the label @ tags. |
int |
legendMargin
margin of the legend. |
java.lang.String |
title
title of the legend |
boolean |
verticalLayout
if false the items will be displayed from left to right. |
Fields inherited from class com.java4less.rchart.ChartComponent |
height, width, x, y |
Constructor Summary | |
Legend()
|
Method Summary | |
void |
addItem(java.lang.String name,
java.lang.Object icon)
Adds an item. |
void |
draw(ChartGraphics g)
|
void |
drawHorizontal(ChartGraphics g)
|
void |
drawVertical(ChartGraphics g)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public FillStyle background
public LineStyle border
public int legendMargin
public java.lang.String title
public ChartColor color
public ChartFont font
public boolean verticalLayout
public java.lang.String legendLabel
Constructor Detail |
public Legend()
Method Detail |
public void addItem(java.lang.String name, java.lang.Object icon)
public void draw(ChartGraphics g)
public void drawHorizontal(ChartGraphics g)
public void drawVertical(ChartGraphics g)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |