[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Image/Graph/Axis/ -> Category.php (sommaire)

Class for axis handling. PHP versions 4 and 5

Author: Jesper Veggerby <pear.nosey@veggerby.dk>
Copyright: Copyright (C) 2003, 2004 Jesper Veggerby Hansen
License: http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
Version: CVS: $Id: Category.php,v 1.19 2006/03/02 12:15:17 nosey Exp $
Poids: 437 lignes (14 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 1 fichier
 Image/Graph/Axis.php

Définit 1 class

Image_Graph_Axis_Category:: (16 méthodes):
  Image_Graph_Axis_Category()
  _getMinimum()
  _getMaximum()
  _setMinimum()
  _setMaximum()
  forceMinimum()
  forceMaximum()
  setLabelInterval()
  _value()
  _minorLabelInterval()
  _size()
  _applyDataset()
  _labelDistance()
  _getNextLabel()
  _isNumeric()
  _done()


Classe: Image_Graph_Axis_Category  - X-Ref

A normal axis thats displays labels with a 'interval' of 1.
This is basically a normal axis where the range is
the number of labels defined, that is the range is explicitly defined
when constructing the axis.

Image_Graph_Axis_Category($type = IMAGE_GRAPH_AXIS_X)   X-Ref
Image_Graph_Axis_Category [Constructor].

param: int $type The type (direction) of the Axis

_getMinimum()   X-Ref
Gets the minimum value the axis will show.

This is always 0

return: double The minumum value

_getMaximum()   X-Ref
Gets the maximum value the axis will show.

This is always the number of labels passed to the constructor.

return: double The maximum value

_setMinimum($minimum)   X-Ref
Sets the minimum value the axis will show.

A minimum cannot be set on a SequentialAxis, it is always 0.

param: double Minimum The minumum value to use on the axis

_setMaximum($maximum)   X-Ref
Sets the maximum value the axis will show

A maximum cannot be set on a SequentialAxis, it is always the number
of labels passed to the constructor.

param: double Maximum The maximum value to use on the axis

forceMinimum($minimum, $userEnforce = true)   X-Ref
Forces the minimum value of the axis

<b>A minimum cannot be set on this type of axis</b>

To modify the labels which are displayed on the axis, instead use
setLabelInterval($labels) where $labels is an array containing the
values/labels the axis should display. <b>Note!</b> Only values in
this array will then be displayed on the graph!

param: double $minimum A minimum cannot be set on this type of axis

forceMaximum($maximum, $userEnforce = true)   X-Ref
Forces the maximum value of the axis

<b>A maximum cannot be set on this type of axis</b>

To modify the labels which are displayed on the axis, instead use
setLabelInterval($labels) where $labels is an array containing the
values/labels the axis should display. <b>Note!</b> Only values in
this array will then be displayed on the graph!

param: double $maximum A maximum cannot be set on this type of axis

setLabelInterval($labelInterval = 'auto', $level = 1)   X-Ref
Sets an interval for where labels are shown on the axis.

The label interval is rounded to nearest integer value.

param: double $labelInterval The interval with which labels are shown

_value($value)   X-Ref
Preprocessor for values, ie for using logarithmic axis

param: double $value The value to preprocess
return: double The preprocessed value

_minorLabelInterval()   X-Ref
Get the minor label interval with which axis label ticks are drawn.

For a sequential axis this is always disabled (i.e false)

return: double The minor label interval, always false

_size()   X-Ref
Get the size in pixels of the axis.

For an x-axis this is the width of the axis including labels, and for an
y-axis it is the corrresponding height

return: int The size of the axis

_applyDataset(&$dataset)   X-Ref
Apply the dataset to the axis.

This calculates the order of the categories, which is very important
for fx. line plots, so that the line does not "go backwards", consider
these X-sets:<p>
1: (1, 2, 3, 4, 5, 6)<br>
2: (0, 1, 2, 3, 4, 5, 6, 7)<p>
If they are not ordered, but simply appended, the categories on the axis
would be:<p>
X: (1, 2, 3, 4, 5, 6, 0, 7)<p>
Which would render the a line for the second plot to show incorrectly.
Instead this algorithm, uses and 'value- is- before' method to see that
the 0 is before a 1 in the second set, and that it should also be before
a 1 in the X set. Hence:<p>
X: (0, 1, 2, 3, 4, 5, 6, 7)

param: Image_Graph_Dataset $dataset The dataset

_labelDistance($level = 1)   X-Ref
Return the label distance.

return: int The distance between 2 adjacent labels

_getNextLabel($currentLabel = false, $level = 1)   X-Ref
Get next label point

param: doubt $point The current point, if omitted or false, the first is
return: double The next label point

_isNumeric()   X-Ref
Is the axis numeric or not?

return: bool True if numeric, false if not

_done()   X-Ref
Output the axis

return: bool Was the output 'good' (true) or 'bad' (false).



Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7