| core_gfx

# Class: Bs_IntervalChart Source Location: /core/gfx/chart/Bs_IntervalChart.class.php
### Class Overview
    Bs_Object
       |
       --Bs_IntervalChart
INTERVAL Chart Class. #### Author(s): andrej arn <at blueshoes dot org> #### Version: 4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:37 $ #### Copyright: blueshoes.org | ### Variables $Bs_Array $chartCaptionX $chartCaptionY $chartHeight $chartTitle $chartType $chartUseShadow $chartWidth | ### Methods Bs_IntervalChart addRow draw setData setInterval
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 52] INTERVAL Chart Class. What's this class for? There are many things that happen in intervals. For example a human blinks (with his eyes) about 17 times a minute, afaik. Now everytime you do it you could record it to a file, db or whatever - with a timestamp. Later you can pass this data to this class, and tell it to draw a line or bar chart. It can (currently) be a monthly or daily chart. So you could see how often you've blinked yesterday, and how often today. With no additional coding. Other time intervals like minute (see setInterval()) can easily be added. Btw, when you play games it really makes a difference, your blinking goes down to about 3-4/minute. todo: - if a month has less than 31 days, then show less. make use of Bs_DailyText or so. for month names etc. dependencies: jpGraph, Bs_Array, #### Tags:
pattern: | singleton: (pseudostatic)
since: | bs4.3
access: | public
version: | 4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:37 $
copyright: | blueshoes.org
author: | andrej arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $Bs_Array = [line 114] reference to global pseudostatic object. gets set in the constructor. #### Tags:
access: | public
Type: | object
[ Top ] #### $chartCaptionX = [line 81] caption for the x-row. #### Tags:
access: | public
Type: | string
[ Top ] #### $chartCaptionY = [line 88] caption for the y-row. #### Tags:
access: | public
Type: | string
[ Top ] #### $chartHeight = 200 [line 67] obvious. #### Tags:
access: | public
Type: | int
[ Top ] #### $chartTitle = [line 74] obvious. #### Tags:
access: | public
Type: | string
[ Top ] #### $chartType = 'line' [line 98] the type of the chart. default is 'line'. one of: line bar #### Tags:
var: | chartType
access: | public
Type: | string
[ Top ] #### $chartUseShadow = FALSE [line 106] if a shodow should be drawn in the chart picture (bottom right). i think the charts look nicer with that shadow. #### Tags:
access: | public
Type: | bool
[ Top ] #### $chartWidth = 600 [line 60] obvious. #### Tags:
access: | public
Type: | int
[ Top ] ### Class Methods ### constructor Bs_IntervalChart [line 148]
`Bs_IntervalChart Bs_IntervalChart( )`
constructor. [ Top ] ### method addRow [line 176]
`void addRow( array $row, [string $legend = NULL])`
adds a data row. #### Tags:
see: | $this->setData()
access: | public
#### Parameters:
array | $row |
string | $legend |
[ Top ] ### method draw [line 311]
`? draw( [string $name = NULL])`
obvious. #### Tags:
access: | public
#### Parameters:
string | $name | (if given then the file will be cached under that name, and not spitted out.)
[ Top ] ### method setData [line 162]
`void setData( array $data, [array $legendData = NULL])`
sets the data. #### Tags:
see: | $this->addRow()
access: | public
#### Parameters:
array | $data | (hash where key=timestamp, value=number)
array | $legendData |
[ Top ] ### method setInterval [line 197]
`void setInterval( mixed $interval)`
sets the interval for the graph. options are: 'year', 'month', 'week', 'day', 'hour', 'minute', 'second'. if nothing gets set then the default is used: 'day'. #### Tags:
todo: | code support for all options. currently only 'month' and 'day' are supported. see _groupDataByInterval() and _fillDataGaps().
access: | public
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:11:21 +0100 by phpDocumentor 1.2.3