|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Graph
Defined in graph.js
Version: 1.1
Author: Mathieu HENRI, Opera Software ASA
Field Summary | |
String |
bgColor
the background limit colors ( '#ffcc99' by default ) |
<private> Array |
dataSets
|
String |
fgColor
the foreground limit colors ( '#336600' by default ) |
String |
height
the height of the graphs ( '360px' by default ) |
<private> Array |
labels
|
<private> String |
rendererMethodPrefix
'renderer_' use this prefix to name the renderer methods you add to the prototype |
String |
title
'untitled Graph' |
String |
width
the width of the graphs ( '480px' by default ) |
Constructor Summary | |
Graph
()
Graph class. |
Method Summary | |
Boolean
|
addDataSet( <String> _dataId, <Array> _dataSet, <String> _color )
adds a set of data. |
Object
|
getDataRange()
get the min/max range of the dataSets. |
String
|
getDataSetColor( <Number> index )
get the color of a given dataSet or a stable pseudo random color in the [ bgColor ; fgColor ] range. |
Array
|
getDataSets()
get the labels. |
Array
|
getLabels()
get the labels. |
<private> Boolean
|
isArray( what )
check if a variable is an Array. |
Array
|
listStyles()
list the renderers. |
Boolean
|
render( <String> _style, <HTMLElement> _renderTarget )
render the graph |
Boolean
|
renderer_accumulatedLines( svg )
'accumulatedLines' graph renderer |
Boolean
|
renderer_bars( svg )
'bars' graph renderer |
Boolean
|
renderer_lines( svg )
'lines' graph renderer |
Boolean
|
renderer_pie( svg )
'pie' graph renderer |
<private> void
|
reset()
reset the graph. |
Boolean
|
setLabels( <Array> _labels )
set the labels. |
Field Detail |
String bgColor
<private> Array dataSets
String fgColor
String height
<private> Array labels
<private> String rendererMethodPrefix
String title
String width
Constructor Detail |
Graph()
Method Detail |
Boolean addDataSet( <String> _dataId, <Array> _dataSet, <String> _color )
_dataId
- the id of the dataSet
_dataSet
- an array of numbers
_color
- [OPTIONNAL] the color to use for this dataSet
Object getDataRange()
String getDataSetColor( <Number> index )
index
- the index of the dataSet
Array getDataSets()
Array getLabels()
<private> Boolean isArray( what )
what
- the variable to test
Array listStyles()
Boolean render( <String> _style, <HTMLElement> _renderTarget )
_style
- the renderer to use
_renderTarget
- [OPTIONNAL] the HTMLElement where the graph must be rendered, document.body by default
Boolean renderer_accumulatedLines( svg )
svg
- {SVGElement} the SVG render target
Boolean renderer_bars( svg )
svg
- {SVGElement} the SVG render target
Boolean renderer_lines( svg )
svg
- {SVGElement} the SVG render target
Boolean renderer_pie( svg )
svg
- {SVGElement} the SVG render target
<private> void reset()
Boolean setLabels( <Array> _labels )
_labels
- the array of labels
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |