All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MSBChart.Chart

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----MSBChart.Chart

public class Chart
extends Canvas

Main class of RChart, it links everythings together; axis, plotter, legend, title... RChart calculates the position and size of all the components and calls the draw method of all of them.

Chart is an extension of Canvas so you can put it on your frames, windows, etc...


Variable Index

 o autoSize
 o axisMargin
 o back
 o border
 o bottomMargin
 o d
 o dnum
 o layout
 o LAYOUT_LEGEND_BOTTOM
 o LAYOUT_LEGEND_RIGHT
 o LAYOUT_LEGEND_TOP
 o leftMargin
 o legend
 o legendMargin
 o Plotters
 o title
 o topMargin
 o XAxis
 o XLabel
 o YAxis
 o YLabel

Constructor Index

 o Chart(Title, Plotter, Axis, Axis)

Method Index

 o addPlotter(Plotter)
 o addSerie(DataSerie)
 o paint(Graphics)

Variables

 o LAYOUT_LEGEND_RIGHT
 public static final int LAYOUT_LEGEND_RIGHT
 o LAYOUT_LEGEND_TOP
 public static final int LAYOUT_LEGEND_TOP
 o LAYOUT_LEGEND_BOTTOM
 public static final int LAYOUT_LEGEND_BOTTOM
 o YLabel
 public VAxisLabel YLabel
Label to be displayed along the Y axis.
 o XLabel
 public HAxisLabel XLabel
Label to be displayed along the X axis.
 o legend
 public Legend legend
 o XAxis
 public Axis XAxis
 o YAxis
 public Axis YAxis
 o title
 public Title title
 o bottomMargin
 public double bottomMargin
area reserved for the x axis. The default is 0.1 (10%).
 
 o topMargin
 public double topMargin
area reserved for the title. The default is 0.1 (10%).
 o leftMargin
 public double leftMargin
area reserved for the y axis. The default is 0.1 (10%).
 
 o legendMargin
 public double legendMargin
area reserved for the legend. The default is 0.1 (10%).
 
 o axisMargin
 public double axisMargin
 o autoSize
 public boolean autoSize

if true (default) the position and size of the components will be calculated automatically. If not you must assign a value to the fields x,y,width and height of ChartComponent.

 
 o Plotters
 public Plotter Plotters[]
 o layout
 public int layout

position of the legend in the chart. Valid values are LAYOUT_LEGEND_TOP,LAYOUT_LEGEND_BOTTOM and LAYOUT_LEGEND_RIGHT (default).

 o back
 public FillStyle back
background of the chart.
 
 o border
 public LineStyle border
border of the chart.
 

Constructors

 o Chart
 public Chart(Title t,
              Plotter p,
              Axis X,
              Axis Y)
creates a chart for the specified components. X and Y will be null for a PiePlotter.

Methods

 o addPlotter
 public void addPlotter(Plotter p)
adds an extra plotter to the chart. In this way it is possible to combine bar charts and line charts.
 o addSerie
 public void addSerie(DataSerie s)

adds a serie to the plotter (the one used in the constructor). This method just calls the addSerie method od the plotter, so you can call the plotter's method directly.

 o paint
 public void paint(Graphics g)
Overrides:
paint in class Canvas

All Packages  Class Hierarchy  This Package  Previous  Next  Index