com.java4less.rchart
Class Title

java.lang.Object
  |
  +--com.java4less.rchart.ChartComponent
        |
        +--com.java4less.rchart.Title

public class Title
extends ChartComponent

The title will be displayed as text above the chart. You can create a title like this:

com.java4less.rchart.Title title=new Title("Sales (thousands $)");

the title is specified in the constructor of the chart class.

If you need more space for the title you can modify the topMargin property of the chart.

You can also construct your own title classes if you want, just implement in the draw method the kind of drawing you want to make.


Field Summary
 ChartColor color
          color used for the title
 ChartFont font
          font used for the title
 java.lang.String text
          text of the title.
 
Fields inherited from class com.java4less.rchart.ChartComponent
height, width, x, y
 
Constructor Summary
Title(java.lang.String t)
          Constructs a title with the specified text.
 
Method Summary
 void draw(ChartGraphics g)
          draws the title.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

public java.lang.String text
text of the title.


font

public ChartFont font
font used for the title


color

public ChartColor color
color used for the title

Constructor Detail

Title

public Title(java.lang.String t)
Constructs a title with the specified text.

Parameters:
t - text of the title
Method Detail

draw

public void draw(ChartGraphics g)
draws the title. If you create you own title class you must draw here but you must draw within the coordinates of the ChartComponent

Parameters:
g - graphics context