com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Class: Axis

Source Location: /_includes/lib_graphs.php

Class Overview


Desribes an graph axis. The axis is graded and can extend those marks to a grid if desired. The grades' labels can be altered with callbacks.


Author(s):

  • Andreas Launila

Variables

Methods



Class Details

[line 422]
Desribes an graph axis. The axis is graded and can extend those marks to a grid if desired. The grades' labels can be altered with callbacks.



Tags:

author:  Andreas Launila


[ Top ]


Class Variables

$displayGrid =

[line 428]

True if the axis should display a grid, false otherwise. The default is false.



Tags:

access:  private

Type:   boolean


[ Top ]

$labels =

[line 435]

The labels that should be printed along the axis. The key is the distance in pixels along the axis that the corresponding value should be centered around.



Tags:

access:  private

Type:   array


[ Top ]



Class Methods


constructor __construct [line 444]

Axis __construct( array $labels, array $color)

Constructor for axis. Sets the labels that should be used for the axis.



Tags:

access:  public


Parameters:

array   $labels   The key should be the distance in pixels along the axis that the corresponding value should be centered around.
array   $color   An optional RGB color array representing the color that the axis and its labels should have.

[ Top ]

method addVectors [line 549]

array addVectors( array $vector1, array $vector2)

Adds two of vectors.



Tags:

return:  A vector sum.
access:  private


Parameters:

array   $vector1   The first vector to add.
array   $vector2   The second vector to add.

[ Top ]

method drawAxis [line 472]

void drawAxis( mixed &$img, color $color, color $gridColor, integer $startX, integer $startY, integer $endX, integer $endY)

Draws the axis at a specified position in a specified image.



Tags:

access:  public


Parameters:

color   $color   The color that should be used to draw the axis.
color   $gridColor   the Color that should be used to draw the axis' grids.
integer   $startX   The x coordinate where the axis should start.
integer   $startY   The y coordinate where the axis should start.
integer   $endX   The x coordinate where the axis should end.
integer   $endY   The y coordinate where the axis should end.

[ Top ]

method scaleVector [line 535]

array scaleVector( array $vector, integer $scalar)

Scales a specified vector with a specified scalar.



Tags:

return:  A scaled vector.
access:  private


Parameters:

array   $vector   The vector to scale.
integer   $scalar   The scalar to scale with.

[ Top ]

method setGrid [line 458]

void setGrid( boolean $useGrids, array $gridColor)

Sets if grids should be used or not. One can also specify what color the grid should be.



Tags:

access:  public


Parameters:

boolean   $useGrids   True if grids should eminate from the axis wherever an label is displayed.
array   $gridColor   An optional RGB color array representing the color that the grid should have. The default is black.

[ Top ]


Documentation generated on Sun, 16 Apr 2006 21:03:33 +0200 by phpDocumentor 1.3.0RC4