Name | Type | Description |
---|---|---|
title | Text | Axis title text |
scale | LinearScale/LogScale | Scale used for axis |
Hide the axis
Argument | Default | Description |
---|---|---|
$aHide | true | Flag. |
Example:
Hide the first and last label on the scale.
Example:
Hide the first label
Argument | Default | Description |
---|---|---|
$aShow | false | Flag. |
This is probably of less use for the end user of the library.
Example:
Hide all labels on the axis
Argument | Default | Description |
---|---|---|
$aHide | true | true=Hide all labels |
Example:
Hide the last tick label on the axis.
Argument | Default | Description |
---|---|---|
$aShow | false | Flag |
Example:
// Hide the actual axis-line, but still print the labels
Argument | Default | Description |
---|---|---|
$aHide | true | True=Hide axis line |
Example:
Hide minor or major tick marks.
Argument | Default | Description |
---|---|---|
$aHideMinor | true | True = Hide minor tick marks |
$aHideMajor | true | True = Hide major tick marks |
Example:
Hide zero label
Argument | Default | Description |
---|---|---|
$aFlag | true | Flag. |
Example:
Specify color of Axis and it's labels
Argument | Default | Description |
---|---|---|
$aColor | Color for axis | |
$aLabelColor | false | Color for labels on axis |
Example:
Set the font for labels on the axis
Argument | Default | Description |
---|---|---|
$aFamily | Font family | |
$aStyle | FS_NORMAL | Font style |
$aSize | 10 | Font size |
Example:
Specify horizontal and vertical alignment for labels
Argument | Default | Description |
---|---|---|
$aHAlign | Horizontal alignment | |
$aVAlign | 'top' | Vertical alignment |
$aParagraphAlign | 'left' | paragraph align for multi-line texts |
Note that this is handled automatically but on some occasion there is a genuine need to override the automtic values. For example if the graph is rotated it might be necessary to adjust the alignment to get a visual acceptable label alignment.
Possible horizontal alignment are: 'left', 'center', 'right'
Possible vertical alignment are: 'top', 'center', 'bottom'
See horizbarex1.php, horizbarex2.php for real life examples.
Example:
Specify the angle for the tick labels
Argument | Default | Description |
---|---|---|
$aAngle | Angle in degrees |
Note:
If you want to use any angles other than 0 and 90 degrees you must make sure that the labels are using TTF fonts. Internal fonts only support vertical and horizontal angles.
Example:
Specify printf() format string for labels
Argument | Default | Description |
---|---|---|
$aFormStr | Format string |
Example:
Specify callback function for labels on axis
Argument | Default | Description |
---|---|---|
$aFuncName | Callback function |
The callback routine is called with one argument, the current number to be displayed and should return the number to be displayed.
For simple formatting use SetlabelFormat() to specify a printf() style formatting string.
The callback function specified should can either be a global function or a class method, for example
$SomeClass = new SomeClass(...); ... $g->SetXLabelFormatCallback(array($SomeClass,'xLabelCallback'));
There is, however, one caution. Any $this data used within LabelFormatCallbackInDerivedClass MUST BE SET BEFORE SetLabelFormatCallback is invoked! it appears that $this is bound/copied when SetLabelFormatCallback is invoked. Only $this data defined at that time is available within the callback function! Likewise, modifications to $this data AFTER SetLabelFormatCallback have no effect since the $this object used by the callback function has already been bound/copied.
The same issues obtain when the callback function is in a seperate class!
For a full example see barscalecallbackex1.php
Example:
Specify a printf()-style format string for labels.
Argument | Default | Description |
---|---|---|
$aFormStr | Format string | |
$aDate | false | No description available |
Example:
Specify margin between labels and tick marks
Argument | Default | Description |
---|---|---|
$aMargin | Margin in pixels |
Example:
Specify what side of the axis labels should be on.
Argument | Default | Description |
---|---|---|
$aSidePos | Which side of the axis the labels should be on |
See topaxisex1.php for an example when this is usefull.
Note: Synonym to SetLabelPos()
Example:
// Manually specify major tick positions and optional labels
Argument | Default | Description |
---|---|---|
$aMajPos | No description available | |
$aLabels | NULL | No description available |
Position for axis line on the "other" scale
Argument | Default | Description |
---|---|---|
$aPosOnOtherScale | Position in world-coordinate |
See topaxisex1.php for a real life example.
Example:
Position the multiple Y-axis
Argument | Default | Description |
---|---|---|
$aDelta | Delta in pixels |
Specify interval for for test labels
Argument | Default | Description |
---|---|---|
$aStep | Intervall |
Example:
Specify what ticks should be displayed
Argument | Default | Description |
---|---|---|
$aStep | Intervall between ticks | |
$aStart | 0 | Start tick |
Example:
Specify text labels for the ticks. One label for each data point
Argument | Default | Description |
---|---|---|
$aLabelArray | Array with labels | |
$aLabelColorArray | null | Individual colors for each label |
If fewer labels than data points are specified then the missing labels will be set to the data points ordinal numbers.
The color argment is an array that can be used to specify individual colors for each of the labels. If fewer colors than labels are specified then the colors will wrap around.
Example:
// Manually specify the major and (optional) minor tick position and labels
Argument | Default | Description |
---|---|---|
$aMajPos | No description available | |
$aMinPos | NULL | No description available |
$aLabels | NULL | No description available |
Specify what side of the axis the ticks should be at
Argument | Default | Description |
---|---|---|
$aDir | Specify side |
This is a shortform for accessing the tick method directly via the scale in the axis.
See topaxisex1.php for real life example.
Example:
Argument | Default | Description |
---|---|---|
$aMajSize | No description available | |
$aMinSize | 3 | No description available |
Title for axis
Argument | Default | Description |
---|---|---|
$aTitle | Title string | |
$aAdjustAlign | 'high' | Alignment of title along the axis |
Example:
Specify distance from the axis
Argument | Default | Description |
---|---|---|
$aMargin | Margin in pixels |
Example:
Specify what side of the axis the title should be at
Argument | Default | Description |
---|---|---|
$aSideOfAxis | Side |
By default x-axis have the title below the axis and y-axis have it on the left and y2 on the right.
See topaxisex1.php for real life example
Example:
Weight of axis
Argument | Default | Description |
---|---|---|
$aWeight | Weight in pixels |
Example:
// should be labeled.
Argument | Default | Description |
---|---|---|
$img | No description available | |
$aScale | No description available | |
$color | No description available | |
No description available | ||
array(0,0,0) | No description available |