All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MSBChart.Legend

java.lang.Object
   |
   +----MSBChart.ChartComponent
           |
           +----MSBChart.Legend

public class Legend
extends ChartComponent

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;

 

 


Variable Index

 o background
 o border
 o color
 o font
 o legendMargin
 o verticalLayout

Constructor Index

 o Legend()

Method Index

 o addItem(String, Object)
 o draw(Graphics)

Variables

 o background
 public FillStyle background
background of the legend.
 o border
 public LineStyle border
border of the legend.
 o legendMargin
 public int legendMargin
margin of the legend.
 o color
 public Color color
 o font
 public Font font
 o verticalLayout
 public boolean verticalLayout
if false the items will be displayed from left to right.

Constructors

 o Legend
 public Legend()

Methods

 o addItem
 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.
 o draw
 public void draw(Graphics g)

All Packages  Class Hierarchy  This Package  Previous  Next  Index