All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----MSBChart.ChartComponent | +----MSBChart.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:
Example:
Legend l=new Legend();
l.border=new LineStyle(0.2f,java.awt.Color.black,LineStyle.LINE_NORMAL);
l.addItem("Company A",new FillStyle(java.awt.Color.cyan));
l.addItem("Company B",new FillStyle(java.awt.Color.green));
the legend must be assigned to the chart:
chart.legend=l;
public FillStyle background
background of the legend.
public LineStyle border
border of the legend.
public int legendMargin
margin of the legend.
public Color color
public Font font
public boolean verticalLayout
if false the items will be displayed from left to right.
public Legend()
public void addItem(String Name, Object icon)
Adds an item. The item is a description and an icon. The icon can be an Image, a Linestyle or a FillStyle.
public void draw(Graphics g)
All Packages Class Hierarchy This Package Previous Next Index