Class to transform chart primitives into image primitives. This renderer renders the charts in a isometric three dimensional view.
The class options are defined in the class ezcGraphRenderer3dOptions extending the basic renderer options in ezcGraphRendererOptions.
Source for this file: /Graph/src/renderer/3d.php
ezcGraphRenderer | --ezcGraphRenderer3d
Version: | //autogentag// |
protected array |
$axisLabels
= array()
Collect axis labels, so that the axis are drawn, when all axis spaces are known. |
protected array |
$barPostProcessing
= array()
Collects bar sides to draw them in a post processing step to simulate a simple z buffer. array( array( 'index' => (int) // used for sorting 'context' => ezcGraphContext // context of call 'method' => (string) // method of driver to call 'parameters' => array // parameters for method call ), ... ) |
protected array |
$circleSectors
= array()
Collects circle sectors to draw shadow in background of all circle sectors. |
protected ezcGraphBoundings |
$dataBoundings
= false
Boundings for the chart data |
protected float |
$depth
= false
Depth of displayed pseudo three dimensional line chart elements. |
protected array |
$frontLines
= array()
Array containing lines from the axis and grid which should be redrawn on top of the data. |
protected array |
$linePostSymbols
= array()
Array with symbols for post processing, which ensures, that the symbols are rendered topmost. |
protected ezcGraphRenderer3dOptions |
$options
Options |
protected ezcGraphBoundings |
$pieSegmentBoundings
= false
Contains the boundings used for pie segments |
protected array |
$pieSegmentLabels
= array(
Pie segment labels divided into two array, containing the labels on the left and right side of the pie chart center. |
protected float |
$xDepthFactor
= false
Factor to reduce the width according to depth |
protected float |
$yDepthFactor
= false
Factor to reduce the height according to depth |
From ezcGraphRenderer | |
---|---|
protected |
ezcGraphRenderer::$driver
|
protected |
ezcGraphRenderer::$elements
|
protected |
ezcGraphRenderer::$xAxisSpace
|
protected |
ezcGraphRenderer::$yAxisSpace
|
public void |
drawAxis(
$boundings
, $start
, $end
, $axis
, [ $labelClass
= null] )
Draw axis |
public void |
drawBackgroundImage(
$boundings
, $file
, [ $position
= 48] , [ $repeat
= ezcGraph::NO_REPEAT] )
Draw background image |
public void |
drawBar(
$boundings
, $context
, $color
, $position
, $stepSize
, [ $dataNumber
= 1] , [ $dataCount
= 1] , [ $symbol
= ezcGraph::NO_SYMBOL] , [ $axisPosition
= 0.] )
Draw bar |
public ezcGraphBoundings |
drawBox(
$boundings
, [ $background
= null] , [ $borderColor
= null] , [ $borderWidth
= 0] , [ $margin
= 0] , [ $padding
= 0] , [ $title
= false] , [ $titleSize
= 16] )
Draw box |
protected void |
drawCircularBar(
$context
, $color
, $position
, $barWidth
, $offset
, $axisPosition
, $startDepth
, $midDepth
, $endDepth
, $symbol
)
Draws a bar with a circular ground shape. |
public void |
drawDataHighlightText(
$boundings
, $context
, $end
, [ $axisPosition
= 0.] , [ $dataNumber
= 1] , [ $dataCount
= 1] , $font
, $text
, $size
, [ $markLines
= null] , [ $xOffset
= 0] , [ $yOffset
= 0] , [ $stepSize
= 0.] , [ $type
= ezcGraph::LINE] )
Draws a highlight textbox for a datapoint. |
public void |
drawDataLine(
$boundings
, $context
, $color
, $start
, $end
, [ $dataNumber
= 0] , [ $dataCount
= 1] , [ $symbol
= ezcGraph::NO_SYMBOL] , [ $symbolColor
= null] , [ $fillColor
= null] , [ $axisPosition
= 0.] , [ $thickness
= 1.] )
Draw data line |
protected void |
drawDiamondBar(
$context
, $color
, $position
, $barWidth
, $offset
, $axisPosition
, $startDepth
, $midDepth
, $endDepth
)
Draws a bar with a diamond ground shape. |
public void |
drawGridLine(
$start
, $end
, $color
)
Draw grid line |
public void |
drawLegend(
$boundings
, $legend
, [ $type
= ezcGraph::VERTICAL] )
Draw legend |
public void |
drawPieSegment(
$boundings
, $context
, $color
, [ $startAngle
= .0] , [ $endAngle
= 360.] , [ $label
= false] , [ $moveOut
= false] )
Draw pie segment |
protected void |
drawRectangularBar(
$context
, $color
, $position
, $barWidth
, $offset
, $axisPosition
, $startDepth
, $midDepth
, $endDepth
)
Draws a bar with a rectangular ground shape. |
public void |
drawStackedBar(
$boundings
, $context
, $color
, $start
, $position
, $stepSize
, [ $symbol
= ezcGraph::NO_SYMBOL] , [ $axisPosition
= 0.] )
Draw stacked bar |
public void |
drawStepLine(
$start
, $end
, $color
)
Draw step line |
public void |
drawText(
$boundings
, $text
, [ $align
= ezcGraph::LEFT] , [ $rotation
= null] )
Draw text |
protected void |
finish(
)
Call all postprocessing functions |
protected void |
finishBars(
)
Draw all collected bar elements |
protected void |
finishCirleSectors(
)
Draws the collected circle sectors |
protected void |
finishFrontLines(
)
Draw collected front lines |
protected void |
finishLineSymbols(
)
Draw the collected line symbols |
protected void |
finishPieSegmentLabels(
)
Draws the collected pie segment labels |
protected ezcGraphCoordinate |
get3dCoordinate(
$c
, [ $front
= 1.] )
Calculate the display coordinate from a coordinate |
protected void |
resetRenderer(
)
Reset renderer properties |
From ezcGraphRenderer | |
---|---|
protected void |
ezcGraphRenderer::addElementReference()
Adds a element reference for context |
public abstract void |
ezcGraphRenderer::drawAxis()
Draw axis |
protected void |
ezcGraphRenderer::drawAxisArrowHead()
Draw axis arrow head |
public abstract void |
ezcGraphRenderer::drawBackgroundImage()
Draw background image |
public abstract void |
ezcGraphRenderer::drawBar()
Draw bar |
public abstract ezcGraphBoundings |
ezcGraphRenderer::drawBox()
Draw box |
public abstract void |
ezcGraphRenderer::drawDataHighlightText()
Draws a highlight textbox for a datapoint. |
public abstract void |
ezcGraphRenderer::drawDataLine()
Draw data line |
public abstract void |
ezcGraphRenderer::drawLegend()
Draw legend |
public abstract void |
ezcGraphRenderer::drawPieSegment()
Draw pie segment |
public void |
ezcGraphRenderer::drawSymbol()
Draw Symbol |
public abstract void |
ezcGraphRenderer::drawText()
Draw text |
protected abstract void |
ezcGraphRenderer::finish()
Finish rendering |
public array |
ezcGraphRenderer::getElementReferences()
Return all chart element references |
public void |
ezcGraphRenderer::render()
Finally renders the image |
protected void |
ezcGraphRenderer::resetRenderer()
Reset renderer properties |
public void |
ezcGraphRenderer::setDriver()
Set renderers driver |
Draw axis
Draws an axis form the provided start point to the end point. A specific angle of the axis is not required.
For the labeleing of the axis a sorted array with major steps and an array with minor steps is expected, which are build like this: array( array( 'position' => (float), 'label' => (string), ) ) where the label is optional.
The label renderer class defines how the labels are rendered. For more documentation on this topic have a look at the basic label renderer class.
Additionally it can be specified if a major and minor grid are rendered by defining a color for them. The axis label is used to add a caption for the axis.
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Boundings of axis |
$start |
ezcGraphCoordinate | Start point of axis |
$end |
ezcGraphCoordinate | Endpoint of axis |
$axis |
ezcGraphChartElementAxis | Axis to render |
$labelClass |
ezcGraphAxisLabelRenderer | Used label renderer |
Method | Description |
---|---|
ezcGraphRenderer::drawAxis() |
Draw axis |
Draw background image
Draws a background image at the defined position. If repeat is set the background image will be repeated like any texture.
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Boundings for the background image |
$file |
string | Filename of background image |
$position |
int | Position of background image |
$repeat |
int | Type of repetition |
Method | Description |
---|---|
ezcGraphRenderer::drawBackgroundImage() |
Draw background image |
Draw bar
Draws a bar as a data element in a line chart
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Chart boundings |
$context |
ezcGraphContext | Context of call |
$color |
ezcGraphColor | Color of line |
$position |
ezcGraphCoordinate | Position of data point |
$stepSize |
float | Space which can be used for bars |
$dataNumber |
int | Number of dataset |
$dataCount |
int | Count of datasets in chart |
$symbol |
int | Symbol to draw for line |
$axisPosition |
float | Position of axis for drawing filled lines |
Method | Description |
---|---|
ezcGraphRenderer::drawBar() |
Draw bar |
Draw box
Box are wrapping each major chart element and draw border, background and title to each chart element.
Optionally a padding and margin for each box can be defined.
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Boundings of the box |
$background |
ezcGraphColor | Background color |
$borderColor |
ezcGraphColor | Border color |
$borderWidth |
int | Border width |
$margin |
int | Margin |
$padding |
int | Padding |
$title |
mixed | Title of the box |
$titleSize |
int | Size of title in the box |
Method | Description |
---|---|
ezcGraphRenderer::drawBox() |
Draw box |
Draws a bar with a circular ground shape.
Name | Type | Description |
---|---|---|
$context |
ezcGraphContext | |
$color |
ezcGraphColor | |
$position |
ezcGraphCoordinate | |
$barWidth |
float | |
$offset |
float | |
$axisPosition |
float | |
$startDepth |
float | |
$midDepth |
float | |
$endDepth |
float | |
$symbol |
int |
Draws a highlight textbox for a datapoint.
A highlight textbox for line and bar charts means a box with the current value in the graph.
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Chart boundings |
$context |
ezcGraphContext | Context of call |
$end |
ezcGraphCoordinate | Ending point |
$axisPosition |
float | Position of axis for drawing filled lines |
$dataNumber |
int | Number of dataset |
$dataCount |
int | Count of datasets in chart |
$font |
ezcGraphFontOptions | Font used for highlight string |
$text |
string | Acutual value |
$size |
int | Size of highlight text |
$markLines |
ezcGraphColor | |
$xOffset |
int | |
$yOffset |
int | |
$stepSize |
float | |
$type |
int |
Method | Description |
---|---|
ezcGraphRenderer::drawDataHighlightText() |
Draws a highlight textbox for a datapoint. |
Draw data line
Draws a line as a data element in a line chart
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Chart boundings |
$context |
ezcGraphContext | Context of call |
$color |
ezcGraphColor | Color of line |
$start |
ezcGraphCoordinate | Starting point |
$end |
ezcGraphCoordinate | Ending point |
$dataNumber |
int | Number of dataset |
$dataCount |
int | Count of datasets in chart |
$symbol |
int | Symbol to draw for line |
$symbolColor |
ezcGraphColor | Color of the symbol, defaults to linecolor |
$fillColor |
ezcGraphColor | Color to fill line with |
$axisPosition |
float | Position of axis for drawing filled lines |
$thickness |
float | Line thickness |
Method | Description |
---|---|
ezcGraphRenderer::drawDataLine() |
Draw data line |
Draws a bar with a diamond ground shape.
Name | Type | Description |
---|---|---|
$context |
ezcGraphContext | |
$color |
ezcGraphColor | |
$position |
ezcGraphCoordinate | |
$barWidth |
float | |
$offset |
float | |
$axisPosition |
float | |
$startDepth |
float | |
$midDepth |
float | |
$endDepth |
float |
Draw grid line
Draw line for the grid in the chart background
Name | Type | Description |
---|---|---|
$start |
ezcGraphCoordinate | Start point |
$end |
ezcGraphCoordinate | End point |
$color |
ezcGraphColor | Color of the grid line |
Draw legend
Will draw a legend in the bounding box
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Bounding of legend |
$legend |
ezcGraphChartElementLegend | Legend to draw; |
$type |
int | Type of legend: Protrait or landscape |
Method | Description |
---|---|
ezcGraphRenderer::drawLegend() |
Draw legend |
Draw pie segment
Draws a single pie segment
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Chart boundings |
$context |
ezcGraphContext | Context of call |
$color |
ezcGraphColor | Color of pie segment |
$startAngle |
float | Start angle |
$endAngle |
float | End angle |
$label |
mixed | Label of pie segment |
$moveOut |
bool | Move out from middle for hilighting |
Method | Description |
---|---|
ezcGraphRenderer::drawPieSegment() |
Draw pie segment |
Draws a bar with a rectangular ground shape.
Name | Type | Description |
---|---|---|
$context |
ezcGraphContext | |
$color |
ezcGraphColor | |
$position |
ezcGraphCoordinate | |
$barWidth |
float | |
$offset |
float | |
$axisPosition |
float | |
$startDepth |
float | |
$midDepth |
float | |
$endDepth |
float |
Draw stacked bar
Draws a stacked bar part as a data element in a line chart
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Chart boundings |
$context |
ezcGraphContext | Context of call |
$color |
ezcGraphColor | Color of line |
$start |
ezcGraphCoordinate | |
$position |
ezcGraphCoordinate | |
$stepSize |
float | Space which can be used for bars |
$symbol |
int | Symbol to draw for line |
$axisPosition |
float | Position of axis for drawing filled lines |
Method | Description |
---|---|
ezcGraphStackedBarsRenderer::drawStackedBar() |
Draw stacked bar |
Draw step line
Draw a step (marker for label position) on a axis.
Name | Type | Description |
---|---|---|
$start |
ezcGraphCoordinate | Start point |
$end |
ezcGraphCoordinate | End point |
$color |
ezcGraphColor | Color of the grid line |
Draw text
Draws the provided text in the boundings
Name | Type | Description |
---|---|---|
$boundings |
ezcGraphBoundings | Boundings of text |
$text |
string | Text |
$align |
int | Alignement of text |
$rotation |
ezcGraphRotation |
Method | Description |
---|---|
ezcGraphRenderer::drawText() |
Draw text |
Call all postprocessing functions
Method | Description |
---|---|
ezcGraphRenderer::finish() |
Finish rendering |
Draw all collected bar elements
Draw all collected bar elements after sorting them depending of their position to simulate simple z buffering.
Draws the collected circle sectors
All circle sectors are collected and drawn later to be able to render the shadows of the pie segments in the back of all pie segments, and ensure the correct drawing order for all pie segment elements.
Draw collected front lines
Draw all grid and axis lines, which should be redrawn in front of the data.
Draw the collected line symbols
Symbols for the data lines are collected and delayed to ensure that they are not covered and hidden by other data lines.
Draws the collected pie segment labels
All labels are collected and drawn later to be able to partition the available space for the labels woth knowledge of the overall label count and their required size and optimal position.
Calculate the display coordinate from a coordinate
Calculates the display coordinate of a coordinate depending on the depth setting and the distance of the coordinate to the front of the chart.
Name | Type | Description |
---|---|---|
$c |
ezcGraphCoordinate | Coordinate |
$front |
float | Distance to front (0 - 1) |
Reset renderer properties
Reset all renderer properties, which were calculated during the rendering process, to offer a clean environment for rerendering.
Method | Description |
---|---|
ezcGraphRenderer::resetRenderer() |
Reset renderer properties |