Assuming we start with the traditional two axis graph, one X and one Y axis. You may then change the position of each axis by calling Axis::SetPos($aPosition) You have to remember that you need to specify the position on the other axis. SO you need to specify the world-coordinate for the position. By default the axis are each positioned at the 0-point on the other axis, i.e. the axis will cross at the 0,0 point in the graph.
In addition to the standard positioning you may also use the two special position markers "min" and "max". This will position the axis at the minimum (or maximum) position of the other axis.
For example, to make sure that the X-axis is always at the bottom of the graph (at lowest possible Y-value) you would have to add the line
To change the color and width of the axis you have to make use of the Axis::SetColor() and Axis::SetWeight() methods.
You might also want to add titles to the axis. This is done through the Axis::SetTitle() method. This is actually just a shortcut for accessing the title property direct. Axis::title::Set() which also allow you to set the alignment in one call.
By default the position of the title is to the far right for the X-axis and in the middle (and 90 degrees rotated) for the Y-axis.
You can adjust the position of the title with the help of the second argument to the Axis::SetTitle() method.
The possible positions are "high","middle" and "low" which refers to the scale values on the axis.
One common modification you might want to do to the title is to increase the margin between the axis and the actual title. This is often necessary to do for the Y-axis if the values displayed are large. You may adjust the distance (in pixels) between the axis and the title by using the method Axis::SetTitleMargin()
So for example to increase the margin on the Y-axis you might add the line
to your code.
Finally we mention something about the positioning of tick marks and labels on the axis. You have the possibility to choose what side of the axis the tick marks and the labels should be at. For the X-axis this can be specified as either on the the top (inside the plot area) or at bottom (outside of the plotarea). In the same way you can specify for the Y-axis if the labels ( or ticks) should be on the left or right side.
To adjust the label positioning you have to use the method Axis::SetTitleSide() and to adjust the position of the tick mark you have to use the method SetTickSide()
For example, the following lines added to a script would change side of the labels and tickmarks for the X-axis.
$graph->xaxis-> SetTickSide( SIDE_DOWN);
This technique is for example used if you position the X-axis at the top of the graph as the following example shows.