|
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
svgGraph
Takes an array or multiple arrays of data and outputs a graph in SVG format. The SVG language allows for a high degree of control of the output, thus this class is intended to be extended.
Field Summary | |
string |
$dataX
Array of data holding values for X axis |
string |
$dataY
Two dimensional array holding values for Y axis. |
integer |
$decimalPlacesY
Number of decimal places to show for Y axis tags. |
string |
$error
Contains error messages. |
string |
$extraSVG
Extra SVG to add to graph. |
integer |
$graphicHeight
Total height of svg graphic. |
integer |
$graphicWidth
Total width of svg graphic. |
integer |
$innerPaddingX
Padding between bottom border of plot area and text (tags). |
integer |
$innerPaddingY
Padding between left border of plot area and text (tags). |
string |
$labelX
Label for X axis. |
string |
$labelY
Label for Y axis. |
integer |
$maxY
Maximum value for Y axis values. |
integer |
$minY
Minimum value for Y axis values. |
integer |
$numGridlinesX
Number of grid lines corresponding to X axis. |
integer |
$numGridlinesY
Number of grid lines corresponding to Y axis. |
integer |
$offsetGridlinesX
Offset of first X axis gridline from lower-left of plot area as a fraction of normal gridline spacing. |
integer |
$offsetGridlinesY
Offset of first Y axis gridline from lower-left of plot area as a fraction of normal gridline spacing. |
integer |
$outerPadding
Padding between outer border of graphic area and text (title and labels). |
integer |
$plotHeight
Height of plot area. |
integer |
$plotOffsetX
Offset of plot area from left of graphic area. |
integer |
$plotOffsetY
Offset of plot area from top of graphic area. |
integer |
$plotWidth
Width of plot area. |
integer |
$resolutionY
Resolution for Y axis tags. |
integer |
$rotTagsX
X axis tags rotation. |
integer |
$rotTagsY
Y axis tags rotation. |
string |
$styleBarDefault
Default presentation attributes for bar plots. |
string |
$styleBox
Presentation attributes for box around plot area. |
string |
$styleBoxDefault
Default presentation attributes for box around plot area. |
string |
$styleGridX
Presentation attributes for grid corresponding to X axis. |
string |
$styleGridXDefault
Default presentation attributes for grid corresponding to X axis. |
string |
$styleGridY
Presentation attributes for grid corresponding to Y axis. |
string |
$styleGridYDefault
Default presentation attributes for grid corresponding to X axis. |
string |
$styleLabelX
Presentation attributes for label. |
string |
$styleLabelXDefault
Default presentation attributes for label. |
string |
$styleLabelY
Presentation attributes for label. |
string |
$styleLabelYDefault
Default presentation attributes for label. |
string |
$styleLineDefault
Default presentation attributes for line plots. |
string |
$stylePolylineDefault
Default presentation attributes for polyline plots (inside group tag). |
string |
$styleTagsX
Presentation attributes for X axis tags. |
string |
$styleTagsXDefault
Default presentation attributes for X axis tags. |
string |
$styleTagsY
Presentation attributes for Y axis tags. |
string |
$styleTagsYDefault
Default presentation attributes for Y axis tags. |
string |
$styleTitle
Presentation attributes for title. |
string |
$styleTitleDefault
Default presentation attributes for title. |
string |
$svg
SVG XML result. |
string |
$title
Title for Graph. |
Constructor Summary | |
svgGraph()
Define static variables used in the class. |
Method Summary | |
private array |
_findRange(var $data,
var $min,
var $max,
var $resolution)
Find the maximum and minimum values for a set of data. The $resolution variable is used for rounding maximum and minimum values. If maximum value is 8645 then If $resolution is 0, then maximum value becomes 9000. If $resolution is 1, then maximum value becomes 8700. If $resolution is 2, then maximum value becomes 8650. If $resolution is 3, then maximum value becomes 8645. |
boolean |
bar(var $whichDataSet)
Draw a bar for each data point from the data set selected. |
void |
drawBox()
Draws the box around the plotting area. |
void |
drawGraph()
Calls functions to draw title, labels, tags, grid lines, and box of graph. |
void |
drawGridX()
Draws the grid lines from top to bottom in the plotting area. |
void |
drawGridY()
Draws the grid lines from right to left in the plotting area. |
void |
drawOuterText()
Draw the title and axis labels around the outside of the graphic area. |
void |
drawTagsX()
Draws the axis tag text outside the plotting area on the x axis. |
void |
drawTagsY()
Draws the axis tag text outside the plotting area on the y axis. |
void |
generateSVG()
Generate SVG for entire graph. |
boolean |
init()
Initialises the variables used for drawing points, lines, grid, and ticks in the plotting area. |
void |
line(var $whichDataSet)
Draw line from one point to the next stopping at each. |
void |
outputSVG()
Output SVG as XML text including appropriate HTTP header information. |
boolean |
polyLine(var $whichDataSet)
Draw a line from one point to the next continuously without stopping to draw markers. |
Field Detail |
public string $dataX
public string $dataY
public integer $decimalPlacesY
public string $error
public string $extraSVG
$svg
public integer $graphicHeight
public integer $graphicWidth
public integer $innerPaddingX
public integer $innerPaddingY
public string $labelX
public string $labelY
public integer $maxY
public integer $minY
public integer $numGridlinesX
public integer $numGridlinesY
public integer $offsetGridlinesX
public integer $offsetGridlinesY
public integer $outerPadding
public integer $plotHeight
public integer $plotOffsetX
public integer $plotOffsetY
public integer $plotWidth
public integer $resolutionY
_findRange
.public integer $rotTagsX
public integer $rotTagsY
public string $styleBarDefault
public string $styleBox
public string $styleBoxDefault
public string $styleGridX
public string $styleGridXDefault
public string $styleGridY
public string $styleGridYDefault
public string $styleLabelX
public string $styleLabelXDefault
public string $styleLabelY
public string $styleLabelYDefault
public string $styleLineDefault
public string $stylePolylineDefault
public string $styleTagsX
public string $styleTagsXDefault
public string $styleTagsY
public string $styleTagsYDefault
public string $styleTitle
public string $styleTitleDefault
public string $svg
public string $title
Constructor Detail |
public svgGraph()
Method Detail |
private array _findRange(var $data, var $min, var $max, var $resolution)
$data
- Data to find the range for$min
- Minimum value to start at. If a lower number is found then this value is not used.$max
- Maximum value to start at. If a larger number is found then this value is not used.$resolution
- Resolution for range.public boolean bar(var $whichDataSet)
$whichDataSet
- Which set of data to draw. This is the index of the data array to be used.
public void drawBox()
public void drawGraph()
public void drawGridX()
public void drawGridY()
public void drawOuterText()
public void drawTagsX()
public void drawTagsY()
public void generateSVG()
public boolean init()
public void line(var $whichDataSet)
$whichDataSet
- Which set of data to draw. This is the index of the data array to be used.public void outputSVG()
public boolean polyLine(var $whichDataSet)
$whichDataSet
- Which set of data to draw. This is the index of the data array to be used.
|
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |