Other formatting options of the axis
| Chapter 14. Common features for all Cartesian (x,y) graph types |

## Other formatting options of the axis

### Adjusting and positioning titles on the axis

Each title of the graph can have a title of there own. By default the x-axis has the title on the right and the y-axis have the title in vertical at the top of the graph. The title of the axis is accessed by the title property of the axis for the x- and y-axis as in

`Graph::xaxis::title`

`Graph::yaxis::title`

As a continence the following there methods are provided

- `Axis::SetTitle($aTitle,$aAdjustAlign)`

  This method sets the title text string and the alignnemt of the title. For the x-axis the alignment is pecified as one of the folliwng three strings

  - `"left"`

  - `"center"`

  - `"right"`

  For an y-axis the alignment is set with one of the following three strings

  - `"bottom"`

  - `"middle"`

  - `"top"`

- `Axis::SetTitleMargin($aMargin)`

  The margin is specifies as the number of pixels distance from the axis to the title

- `Axis::SetTitleSide($aSideOfAxis)`

  The side specifies for a horizontal axis (x-axis) if the title should be above or below the axis and for a vertical axis (y-axis) if the title should be on the left or the right of the axis.

  Y-axis defines:

  1. `SIDE_LEFT`

  2. `SIDE_RIGHT`

  X-axis defines

  1. `SIDE_TOP`

  2. `SIDE_BOTTOM`

### Adjusting the font and color of the title

Since the title property can be easily accessed all usual Text class property can be used. This includes the color property. To set the font and color of the title for the x-axis the following methods are used

- `Graph::xaxis::title::SetFont()`

- `Graph::xaxis::title::SetColor()`

For the y- and y2-axis the fonts and colors are set completely analogues.

| Up |
| Home |