[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/renderer/ -> 3d.php (summary)

File containing the three dimensional renderer

Copyright: Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
License: http://ez.no/licenses/new_bsd New BSD License
Version: 1.5
File Size: 2424 lines (89 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphRenderer3d:: (25 methods):
  __construct()
  __get()
  get3dCoordinate()
  drawPieSegment()
  finishPieSegmentLabels()
  finishCirleSectors()
  finishFrontLines()
  finishLineSymbols()
  drawRectangularBar()
  drawDiamondBar()
  drawCircularBar()
  drawBar()
  drawStackedBar()
  finishBars()
  drawDataLine()
  drawDataHighlightText()
  drawLegend()
  drawBox()
  drawText()
  drawGridLine()
  drawStepLine()
  drawAxis()
  drawBackgroundImage()
  finish()
  resetRenderer()


Class: ezcGraphRenderer3d  - X-Ref

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 {@link ezcGraphRenderer3dOptions}
extending the basic renderer options in {@link ezcGraphRendererOptions}.

<code>
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->title = 'Access statistics';
$graph->options->label = '%2$d (%3$.1f%%)';

$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Explorer'] = true;

$graph->renderer = new ezcGraphRenderer3d();

$graph->renderer->options->moveOut = .2;

$graph->renderer->options->pieChartOffset = 63;

$graph->renderer->options->pieChartGleam = .3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';

$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = '#000000';

$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->legendSymbolGleamSize = .9;
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';

$graph->renderer->options->pieChartSymbolColor = '#55575388';

$graph->renderer->options->pieChartHeight = 5;
$graph->renderer->options->pieChartRotation = .8;

$graph->render( 400, 150, 'tutorial_pie_chart_3d.svg' );
</code>

__construct( array $options = array()   X-Ref
Constructor

param: array $options Default option array
return: void

__get( $propertyName )   X-Ref
__get

param: mixed $propertyName
return: mixed

get3dCoordinate( ezcGraphCoordinate $c, $front = 1. )   X-Ref
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.

param: ezcGraphCoordinate $c Coordinate
param: float $front Distance to front (0 - 1)
return: ezcGraphCoordinate Resulting coordinate

drawPieSegment(ezcGraphBoundings $boundings,ezcGraphContext $context,ezcGraphColor $color,$startAngle = .0,$endAngle = 360.,$label = false,$moveOut = false )   X-Ref
Draw pie segment

Draws a single pie segment

param: ezcGraphBoundings $boundings Chart boundings
param: ezcGraphContext $context Context of call
param: ezcGraphColor $color Color of pie segment
param: float $startAngle Start angle
param: float $endAngle End angle
param: mixed $label Label of pie segment
param: bool $moveOut Move out from middle for hilighting
return: void

finishPieSegmentLabels()   X-Ref
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.

return: void

finishCirleSectors()   X-Ref
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.

return: void

finishFrontLines()   X-Ref
Draw collected front lines

Draw all grid and axis lines, which should be redrawn in front of the
data.

return: void

finishLineSymbols()   X-Ref
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.

return: void

drawRectangularBar(ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $position,$barWidth,$offset,$axisPosition,$startDepth,$midDepth,$endDepth )   X-Ref
Draws a bar with a rectangular ground shape.

param: ezcGraphContext $context
param: ezcGraphColor $color
param: ezcGraphCoordinate $position
param: float $barWidth
param: float $offset
param: float $axisPosition
param: float $startDepth
param: float $midDepth
param: float $endDepth
return: void

drawDiamondBar(ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $position,$barWidth,$offset,$axisPosition,$startDepth,$midDepth,$endDepth )   X-Ref
Draws a bar with a diamond ground shape.

param: ezcGraphContext $context
param: ezcGraphColor $color
param: ezcGraphCoordinate $position
param: float $barWidth
param: float $offset
param: float $axisPosition
param: float $startDepth
param: float $midDepth
param: float $endDepth
return: void

drawCircularBar(ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $position,$barWidth,$offset,$axisPosition,$startDepth,$midDepth,$endDepth,$symbol )   X-Ref
Draws a bar with a circular ground shape.

param: ezcGraphContext $context
param: ezcGraphColor $color
param: ezcGraphCoordinate $position
param: float $barWidth
param: float $offset
param: float $axisPosition
param: float $startDepth
param: float $midDepth
param: float $endDepth
param: int $symbol
return: void

drawBar(ezcGraphBoundings $boundings,ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $position,$stepSize,$dataNumber = 1,$dataCount = 1,$symbol = ezcGraph::NO_SYMBOL,$axisPosition = 0. )   X-Ref
Draw bar

Draws a bar as a data element in a line chart

param: ezcGraphBoundings $boundings Chart boundings
param: ezcGraphContext $context Context of call
param: ezcGraphColor $color Color of line
param: ezcGraphCoordinate $position Position of data point
param: float $stepSize Space which can be used for bars
param: int $dataNumber Number of dataset
param: int $dataCount Count of datasets in chart
param: int $symbol Symbol to draw for line
param: float $axisPosition Position of axis for drawing filled lines
return: void

drawStackedBar(ezcGraphBoundings $boundings,ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $start,ezcGraphCoordinate $position,$stepSize,$symbol = ezcGraph::NO_SYMBOL,$axisPosition = 0. )   X-Ref
Draw stacked bar

Draws a stacked bar part as a data element in a line chart

param: ezcGraphBoundings $boundings Chart boundings
param: ezcGraphContext $context Context of call
param: ezcGraphColor $color Color of line
param: ezcGraphCoordinate $start
param: ezcGraphCoordinate $position
param: float $stepSize Space which can be used for bars
param: int $symbol Symbol to draw for line
param: float $axisPosition Position of axis for drawing filled lines
return: void

finishBars()   X-Ref
Draw all collected bar elements

Draw all collected bar elements after sorting them depending of their
position to simulate simple z buffering.

return: void

drawDataLine(ezcGraphBoundings $boundings,ezcGraphContext $context,ezcGraphColor $color,ezcGraphCoordinate $start,ezcGraphCoordinate $end,$dataNumber = 0,$dataCount = 1,$symbol = ezcGraph::NO_SYMBOL,ezcGraphColor $symbolColor = null,ezcGraphColor $fillColor = null,$axisPosition = 0.,$thickness = 1. )   X-Ref
Draw data line

Draws a line as a data element in a line chart

param: ezcGraphBoundings $boundings Chart boundings
param: ezcGraphContext $context Context of call
param: ezcGraphColor $color Color of line
param: ezcGraphCoordinate $start Starting point
param: ezcGraphCoordinate $end Ending point
param: int $dataNumber Number of dataset
param: int $dataCount Count of datasets in chart
param: int $symbol Symbol to draw for line
param: ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor
param: ezcGraphColor $fillColor Color to fill line with
param: float $axisPosition Position of axis for drawing filled lines
param: float $thickness Line thickness
return: void

drawDataHighlightText(ezcGraphBoundings $boundings,ezcGraphContext $context,ezcGraphCoordinate $end,$axisPosition = 0.,$dataNumber = 1,$dataCount = 1,ezcGraphFontOptions $font,$text,$size,ezcGraphColor $markLines = null,$xOffset = 0,$yOffset = 0,$stepSize = 0.,$type = ezcGraph::LINE )   X-Ref
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.

param: ezcGraphBoundings $boundings Chart boundings
param: ezcGraphContext $context Context of call
param: ezcGraphCoordinate $end Ending point
param: float $axisPosition Position of axis for drawing filled lines
param: int $dataNumber Number of dataset
param: int $dataCount Count of datasets in chart
param: ezcGraphFontOptions $font Font used for highlight string
param: string $text Acutual value
param: int $size Size of highlight text
param: ezcGraphColor $markLines
param: int $xOffset
param: int $yOffset
param: float $stepSize
param: int $type
return: void

drawLegend(ezcGraphBoundings $boundings,ezcGraphChartElementLegend $legend,$type = ezcGraph::VERTICAL )   X-Ref
Draw legend

Will draw a legend in the bounding box

param: ezcGraphBoundings $boundings Bounding of legend
param: ezcGraphChartElementLegend $legend Legend to draw;
param: int $type Type of legend: Protrait or landscape
return: void

drawBox(ezcGraphBoundings $boundings,ezcGraphColor $background = null,ezcGraphColor $borderColor = null,$borderWidth = 0,$margin = 0,$padding = 0,$title = false,$titleSize = 16 )   X-Ref
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.

param: ezcGraphBoundings $boundings Boundings of the box
param: ezcGraphColor $background Background color
param: ezcGraphColor $borderColor Border color
param: int $borderWidth Border width
param: int $margin Margin
param: int $padding Padding
param: mixed $title Title of the box
param: int $titleSize Size of title in the box
return: ezcGraphBoundings Remaining inner boundings

drawText(ezcGraphBoundings $boundings,$text,$align = ezcGraph::LEFT,ezcGraphRotation $rotation = null )   X-Ref
Draw text

Draws the provided text in the boundings

param: ezcGraphBoundings $boundings Boundings of text
param: string $text Text
param: int $align Alignement of text
param: ezcGraphRotation $rotation
return: void

drawGridLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color )   X-Ref
Draw grid line

Draw line for the grid in the chart background


param: ezcGraphCoordinate $start Start point
param: ezcGraphCoordinate $end End point
param: ezcGraphColor $color Color of the grid line
return: void

drawStepLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color )   X-Ref
Draw step line

Draw a step (marker for label position) on a axis.

param: ezcGraphCoordinate $start Start point
param: ezcGraphCoordinate $end End point
param: ezcGraphColor $color Color of the grid line
return: void

drawAxis(ezcGraphBoundings $boundings,ezcGraphCoordinate $start,ezcGraphCoordinate $end,ezcGraphChartElementAxis $axis,ezcGraphAxisLabelRenderer $labelClass = null )   X-Ref
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.

param: ezcGraphBoundings $boundings Boundings of axis
param: ezcGraphCoordinate $start Start point of axis
param: ezcGraphCoordinate $end Endpoint of axis
param: ezcGraphChartElementAxis $axis Axis to render
param: ezcGraphAxisLabelRenderer $labelClass Used label renderer
return: void

drawBackgroundImage(ezcGraphBoundings $boundings,$file,$position = 48, $repeat = ezcGraph::NO_REPEAT )   X-Ref
Draw background image

Draws a background image at the defined position. If repeat is set the
background image will be repeated like any texture.

param: ezcGraphBoundings $boundings Boundings for the background image
param: string $file Filename of background image
param: int $position Position of background image
param: int $repeat Type of repetition
return: void

finish()   X-Ref
Call all postprocessing functions

return: void

resetRenderer()   X-Ref
Reset renderer properties

Reset all renderer properties, which were calculated during the
rendering process, to offer a clean environment for rerendering.

return: void



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7