Image_Graph
[ class tree: Image_Graph ] [ index: Image_Graph ] [ all elements ]

Class: Image_Graph_Axis

Source Location: /Image_Graph-0.8.0/Graph/Axis.php

Class Overview

Image_Graph_Common
   |
   --Image_Graph_Element
      |
      --Image_Graph_Plotarea_Element
         |
         --Image_Graph_Axis

Diplays a normal linear axis (either X- or Y-axis).


Author(s):

Version:

  • Release: 0.8.0

Copyright:

  • 2003-2009 The PHP Group

Methods


Child classes:

Image_Graph_Axis_Logarithmic
Diplays a logarithmic axis (either X- or Y-axis).
Image_Graph_Axis_Category
A normal axis thats displays labels with a 'interval' of 1.

Inherited Variables

Inherited Methods

Class: Image_Graph_Element

Image_Graph_Element::height()
The height of the element on the canvas
Image_Graph_Element::setBackground()
Sets the background fill style of the element
Image_Graph_Element::setBackgroundColor()
Sets the background color of the element.
Image_Graph_Element::setBorderColor()
Sets the border color of the element.
Image_Graph_Element::setBorderStyle()
Sets the border line style of the element
Image_Graph_Element::setFillColor()
Sets the fill color of the element.
Image_Graph_Element::setFillStyle()
Sets the fill style of the element
Image_Graph_Element::setFont()
Sets the font of the element
Image_Graph_Element::setFontAngle()
Sets the font angle
Image_Graph_Element::setFontColor()
Sets the font color
Image_Graph_Element::setFontSize()
Sets the font size
Image_Graph_Element::setLineColor()
Sets the line color of the element.
Image_Graph_Element::setLineStyle()
Sets the line style of the element
Image_Graph_Element::setPadding()
Sets padding of the element
Image_Graph_Element::showShadow()
Shows shadow on the element
Image_Graph_Element::width()
The width of the element on the canvas
Image_Graph_Element::write()
Writes text to the canvas.
Image_Graph_Element::_clip()
Clip the canvas to the coordinates of the element

Class: Image_Graph_Common

Image_Graph_Common::Image_Graph_Common()
Constructor [Image_Graph_Common]
Image_Graph_Common::add()
Adds an element to the objects element list.
Image_Graph_Common::addNew()
Creates an object from the class and adds it to the objects element list.
Image_Graph_Common::hide()
Hide the element

Class Details

[line 50]
Diplays a normal linear axis (either X- or Y-axis).


[ Top ]


Method Detail

Image_Graph_Axis (Constructor)   [line 272]

Image_Graph_Axis Image_Graph_Axis( [int $type = IMAGE_GRAPH_AXIS_X])

Image_Graph_Axis [Constructor].

Normally a manual creation should not be necessary, axis are created automatically by the Image_Graph_Plotarea constructor unless explicitly defined otherwise


Parameters:

int   $type     The type (direction) of the Axis, use IMAGE_GRAPH_AXIS_X for an X-axis (default, may be omitted) and IMAGE_GRAPH_AXIS_Y for Y- axis)

[ Top ]

addMark   [line 1008]

void addMark( double $value, [double $value2 = false], [string $text = false])

Adds a mark to the axis at the specified value

Parameters:

double   $value     The value
double   $value2     The second value (for a ranged mark)
string   $text     Text to display at mark (optional)

[ Top ]

forceMaximum   [line 449]

void forceMaximum( double $maximum, [bool $userEnforce = true])

Forces the maximum value of the axis

Overridden in child classes as:

Image_Graph_Axis_Category::forceMaximum()
Forces the maximum value of the axis

Parameters:

double   $maximum     The maximum value to use on the axis
bool   $userEnforce     This value should not be set, used internally

[ Top ]

forceMinimum   [line 432]

void forceMinimum( double $minimum, [bool $userEnforce = true])

Forces the minimum value of the axis

Overridden in child classes as:

Image_Graph_Axis_Category::forceMinimum()
Forces the minimum value of the axis

Parameters:

double   $minimum     The minumum value to use on the axis
bool   $userEnforce     This value should not be set, used internally

[ Top ]

hideArrow   [line 473]

void hideArrow( )

Do not show an arrow head on the 'end' of the axis (default)

[ Top ]

setAxisIntersection   [line 1094]

void setAxisIntersection( mixed $intersection, [mixed $axis = 'default'])

Set axis intersection.

Sets the value at which the axis intersects other axis, fx. at which Y- value the x-axis intersects the y-axis (normally at 0).

Possible values are 'default', 'min', 'max' or a number between axis min and max (the value will automatically be limited to this range).

For a coordinate system with 2 y-axis, the x-axis can either intersect the primary or the secondary y-axis. To make the x-axis intersect the secondary y-axis at a given value pass IMAGE_GRAPH_AXIS_Y_SECONDARY as second parameter.

  • Since: 0.3.0dev2

Parameters:

mixed   $intersection     The value at which the axis intersect the 'other' axis
mixed   $axis     The axis to intersect. Only applies to x-axis with both a primary and secondary y-axis available.

[ Top ]

setDataPreProcessor   [line 363]

void setDataPreProcessor( Image_Graph_DataPreprocessor &$dataPreProcessor)

Sets a data preprocessor for formatting the axis labels

Parameters:

Image_Graph_DataPreprocessor   &$dataPreProcessor     The data preprocessor

[ Top ]

setFixedSize   [line 622]

void setFixedSize( int $size)

Sets a fixed "size" for the axis.

If the axis is any type of y-axis the size relates to the width of the axis, if an x-axis is concerned the size is the height.

  • Since: 0.3.0dev5

Parameters:

int   $size     The fixed size of the axis

[ Top ]

setInverted   [line 1067]

void setInverted( bool $invert)

Invert the axis direction

If the minimum values are normally displayed fx. at the bottom setting axis inversion to true, will cause the minimum values to be displayed at the top and maximum at the bottom.

  • Since: 0.3.0dev3

Parameters:

bool   $invert     True if the axis is to be inverted, false if not

[ Top ]

setLabelInterval   [line 505]

void setLabelInterval( [mixed $labelInterval = 'auto'], [int $level = 1])

Sets an interval for when labels are shown on the axis.

By default 'auto' is used, forcing the axis to calculate a approximate best label interval to be used. Specify an array to use user-defined values for labels.


Overridden in child classes as:

Image_Graph_Axis_Category::setLabelInterval()
Sets an interval for where labels are shown on the axis.

Parameters:

mixed   $labelInterval     The interval with which labels are shown
int   $level     The label level to set the interval on

[ Top ]

setLabelOption   [line 551]

void setLabelOption( string $option, mixed $value, [int $level = 1])

Sets options for the label at a specific level.

Possible options are:

'showtext' true or false whether label text should be shown or not

'showoffset' should the label be shown at an offset, i.e. should the label be shown at a position so that it does not overlap with prior levels. Only applies to multilevel labels with text

'font' The font options as an associated array

'position' The position at which the labels are written ('inside' or 'outside' the axis). NB! This relative position only applies to the default location of the axis, i.e. if an x-axis is inverted then 'outside' still refers to the "left" side of a normal y-axis (since this is normally 'outside') but the actual output will be labels on the "inside"!

'format' To format the label text according to a sprintf statement

'dateformat' To format the label as a date, fx. j. M Y = 29. Jun 2005


Parameters:

string   $option     The label option name (see detailed description for possible values)
mixed   $value     The value for the option
int   $level     The label level to set the interval on

[ Top ]

setLabelOptions   [line 571]

void setLabelOptions( array $options, [int $level = 1])

Sets options for the label at a specific level.

The possible options are specified in Image_Graph_Axis::.


Parameters:

array   $options     An assciated array with label options
int   $level     The label level to set the interval on

[ Top ]

setTickOptions   [line 1043]

void setTickOptions( int $start, int $end, [int $level = 1])

Set the major tick appearance.

The positions are specified in pixels relative to the axis, meaning that a value of -1 for start will draw the major tick 'line' starting at 1 pixel outside (negative) value the axis (i.e. below an x-axis and to the left of a normal y-axis).

  • Since: 0.3.0dev2

Parameters:

int   $start     The start position relative to the axis
int   $end     The end position relative to the axis
int   $level     The label level to set the tick options for

[ Top ]

setTitle   [line 599]

void setTitle( string $title, [Image_Graph_Font $font = false])

Sets the title of this axis.

This is used as an alternative (maybe better) method, than using layout's for axis-title generation.

To use the current propagated font, but just set it vertically, simply pass 'vertical' as second parameter for vertical alignment down-to-up or 'vertical2' for up-to-down alignment.

  • Since: 0.3.0dev2

Parameters:

string   $title     The title of this axis
Image_Graph_Font   $font     The font used for the title

[ Top ]

showArrow   [line 463]

void showArrow( )

Show an arrow head on the 'end' of the axis

[ Top ]

showLabel   [line 348]

void showLabel( int $value)

Shows a label for the the specified values.

Allowed values are combinations of:

  • IMAGE_GRAPH_LABEL_MINIMUM
  • IMAGE_GRAPH_LABEL_ZERO
  • IMAGE_GRAPH_LABEL_MAXIMUM
By default none of these are shows on the axis


Parameters:

int   $value     The values to show labels for

[ Top ]


Documentation generated on Tue, 05 Oct 2010 16:00:17 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.