graphpite
[ class tree: graphpite ] [ index: graphpite ] [ all elements ]
Prev Next
Plot Layout

Plot Layout

The GraPHPite Tutorial

Plot Layout

It is possible to add multiple plots to the same graph, not only withing the same plot, i.e. you can have 2 or more PlotArea specified within the same graph.

The way GraPHPite handles this is utilizing the same method that Java does. This means that when you have 2 elements that you can layout onto the graph, you specify whether they are vertically or horizontally aligned (and at which percentage of the total width/height the split is positioned). This means that you define that "the area covered by this layout, shall be shared by this percentage between these 2 elements". An example:

  1. ...
  2. $Graph->add(
  3. new VerticalLayout(
  4. $PlotArea1 = new PlotArea(),
  5. $PlotArea2 = new PlotArea()
  6. 75
  7. )
  8. );
  9. ...

Layouts can be nested, so it is possble to define more than one arrangements:

  1. ...
  2. $Graph->add(
  3. new VerticalLayout(
  4. new HorizontalLayout(
  5. $PlotArea1 = new PlotArea(),
  6. $PlotArea2 = new PlotArea()
  7. ),
  8. $PlotArea3 = new PlotArea(),
  9. 75
  10. )
  11. );
  12. ...

Not only PlotArea can be "layouted" all subclasses of the abstract class GraPHPLayoutAble can be layouted. These are: PlotArea, Legend and Text (especially Title)

Prev Up Next
Modifying appearance How to use GraPHPite Using Legends

Documentation generated on Fri, 12 Nov 2004 08:24:32 +0100 by phpDocumentor 1.3.0RC3