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:
- ...
- $Graph->add(
- new VerticalLayout(
- $PlotArea1 = new PlotArea(),
- $PlotArea2 = new PlotArea()
- 75
- )
- );
- ...
Layouts can be nested, so it is possble to define more than one arrangements:
- ...
- $Graph->add(
- new VerticalLayout(
- new HorizontalLayout(
- $PlotArea1 = new PlotArea(),
- $PlotArea2 = new PlotArea()
- ),
- $PlotArea3 = new PlotArea(),
- 75
- )
- );
- ...
Not only PlotArea can be "layouted" all subclasses of the abstract class GraPHPLayoutAble can be layouted.
These are: PlotArea, Legend and Text (especially Title)