Class Image_Graph_Axis

Description

Class for storing axis settings

All axes used in the Graph (1 x-axis and 2 y-axes) have common functionality. This class is used for storage of various settings like the axis-type ("linear" or "text"), the axis-title, "ticks" (minor and major lines) and their layout on the axis, the axis-bounds (min/max-values), a representation for numerical values (string in sprintf-format) and colors. The functionality for actually drawing an axis is (currently) implemented in the main class Image_Graph. All specialized features like mapping of values to relative/absolute pixel-values are done in the derived classes for Axis_X and Axis_Y.

Located in /Graph/Elements.php (line 268)

Image_Graph_Base
   |
   --Image_Graph_Axis
Direct descendents
Class Description
 class Image_Graph_Axis_X Class for storing x-axis settings
 class Image_Graph_Axis_Y Class for storing x-axis settings
Variable Summary
Method Summary
 Image_Graph_Axis &Image_Graph_Axis ()
 void setBounds (mixed $min, mixed $max)
 void setNumbercolor (mixed $color)
 void setNumberformat (string $format)
 void setTicksAutoSteps ([int $major = null], [int $minor = null])
 void setTickSize (int $size)
 void setTicksMajor (array $ticks)
 void setTicksMinor (array $ticks)
 void setTickStyle (mixed $style)
Variables
object Image_Graph_Title $title = null (line 276)

Title for axis

  • access: public
object Image_Graph_Axis_Values $values = null (line 284)

Values on the axis

  • access: public
Methods
Constructor Image_Graph_Axis (line 420)

Constructor

The colors for title and values on the axis are not set by default. If you don't explicitly set them, the color of the axis will be inherited.

  • access: public
Image_Graph_Axis &Image_Graph_Axis ()
setBounds (line 439)

Set bounds

You can set the minimum and maximum value on the axis. If you don't want/can't give a min/max value, set it to null for automatic detection. Autodetection of bounds values is enabled by default.

  • access: public
void setBounds (mixed $min, mixed $max)
  • mixed $min: (int/float/null) min-value
  • mixed $max: (int/float/null) max-value
setNumbercolor (line 578)

Set color for numbers on the axis

!! This function is deprecated. Use values->setColor() !!

void setNumbercolor (mixed $color)
  • mixed $color: any color representation supported by Image_Graph_Color::color2RGB()
setNumberformat (line 561)

Set numberformat for axis

!! This function is deprecated. Use values->setNumberformat() !!

void setNumberformat (string $format)
  • string $format: sprintf-formatstring
setTicksAutoSteps (line 460)

Set maximum steps for automatic creation of ticksMajor/ticksMinor

Use this function to set the maximum number of steps for the major/minor ticks that are used if automatic generation of ticks is turned on. If you set your own values for the ticks on the axis this settings will not have an effect. Note that by default the ticks are generated automatically.

void setTicksAutoSteps ([int $major = null], [int $minor = null])
  • int $major: value for steps of ticksMajor (null => default of 5 used)
  • int $minor: value for steps of ticksMinor (null => default of 25 used; at least the minor value)
setTickSize (line 504)

Set size for (major) ticks on axis

The size you set is for the "major ticks". All minor ticks will be half that size.

  • access: public
void setTickSize (int $size)
  • int $size: size in pixels
setTicksMajor (line 526)

Set major ticks on axis

The list of values on the axis indicates where you would like "major ticks" to be drawn. Null results in automatic detection of ticks based upon the auto-steps-setting. Note that drawing of numbers on the axis will be done at all major ticks. If you don't want numbers to be drawn, refer to the minor ticks. Another alternative is to set the numberformat to an empty string.

void setTicksMajor (array $ticks)
  • array $ticks: list of values (int/float) on the axis or null
setTicksMinor (line 545)

Set minor ticks on axis

The list of values on the axis indicates where you would like "major ticks" to be drawn. Null results in automatic detection of ticks based upon the auto-steps-setting. Note that drawing of numbers on the axis will be done only at at the major ticks.

void setTicksMinor (array $ticks)
  • array $ticks: list of values (int/float) on the axis or null
setTickStyle (line 490)

Set tick-style for ticks on a axis

You can have ticks (lines) that are located on the inside of the graph, on the outside or on both sides. For the x-axis "inside" means above the axis. For the y0-axis "inside" means on the right side of the axis, since in most cases it's located on the left side of the graph. For the y1-axis "inside" means on the left side of the axis, since in most cases it's located on the right side of the graph.

  • access: public
void setTickStyle (mixed $style)
  • mixed $style: use constants IMAGE_GRAPH_TICKS_INSIDE, IMAGE_GRAPH_TICKS_OUTSIDE or IMAGE_GRAPH_TICKS_BOTH

Inherited Methods

Inherited From Image_Graph_Base

 Image_Graph_Base::setColor()
 Image_Graph_Base::setFontOptions()
 Image_Graph_Base::setSpacer()
 Image_Graph_Base::setText()

Documentation generated on Sat, 21 Feb 2004 23:28:02 +0100 by phpDocumentor 1.3.0RC2