Contents Previous Next

7.13 Adding titles and footers to the Graph

Each graph can have up to three different titles accessed by the three properties

  1. title
  2. subtitle
  3. subsubtitle

All of these three properties is a standard text object which means that you can have individual font, colors, margins and sizes of these tree titles.

The only thing you need to think of is that you probably want to add some extra margin to make room for the titles (using Graph::SetMargin() )

The individual positioning of these titles are done automatically and will adjust to the font size being used.

If you for, esthetic reasons, would like increase the distance from the top where the title is positioned (or the intra distance between title and sub title) you can use the Text::SetMargin() method. For example the line

 $graph->title->SetMargin (20);

will set the distance between the top of the title string and the top of the graph to 20 pixels. If you instead call the SetMargin() method for the subtitle it will adjust the distance between the top of the subtitle and the bottom of the title.

The titles will be positioned at the top and be centered in the graph. Each of these titles may have multiple lines each separated by a "\n" (newline) character. By default the paragraph alignment for each title is centered but may of course be changed (using the ParagraphAlign()) method.

Each graph can also have a footer. This footer is actually three footers. Left, center and right. The 'left' footer is aligned to the left, the 'center' at the bottom center and the right to the right.

Each of these three positions is a standard Text object which means you can change color, font and size as you please individually on each of these footer positions.

You access the footer through the Graph::footer property as the following example shows

 $graph-> footer->left->Set ("(C) 2002 KXY" );
$graph->footer-> center->Set("CONFIDENTIAL" );
$graph->footer-> center-> SetColor("red");
$graph->footer-> center-> SetFont( FF_FONT2, FS_BOLD);
$graph->footer-> right->Set("19 Aug 2002" );

Note: If you enable the brand timing argument you should leave the left footer empty.


Contents Previous Next