[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/driver/ -> flash.php (summary)

File containing the ezcGraphFlashDriver class

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: 972 lines (34 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphFlashDriver:: (19 methods):
  __construct()
  getDocument()
  setShapeColor()
  modifyCoordinate()
  deModifyCoordinate()
  drawPolygon()
  drawLine()
  getTextBoundings()
  drawTextBox()
  renderText()
  drawAllTexts()
  drawCircleSector()
  simulateCircularArc()
  drawCircularArc()
  drawCircle()
  drawImage()
  getMimeType()
  render()
  getResource()


Class: ezcGraphFlashDriver  - X-Ref

Driver to create Flash4 (SWF) files as graph output. The options of this
class are defined in The options of this class are defined in the option
class {@link ezcGraphFlashDriverOptions} extending the basic
{@link ezcGraphDriverOptions}.

<code>
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->legend = false;

$graph->driver = new ezcGraphFlashDriver();
$graph->options->font = 'tutorial_font.fdb';

$graph->driver->options->compression = 7;

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

$graph->render( 400, 200, 'tutorial_driver_flash.swf' );
</code>


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

param: array $options Default option array
return: void

getDocument()   X-Ref
Returns unique movie object as a parent canvas for all swf objects.

return: SWFMovie

setShapeColor( SWFShape $shape, ezcGraphColor $color, $thickness, $filled )   X-Ref
Set the fill and line properties for a SWWFShape according to the
given parameters.

param: SWFShape $shape
param: ezcGraphColor $color
param: mixed $thickness
param: mixed $filled
return: void

modifyCoordinate( $pointValue )   X-Ref
Modifies a coordinate value, as flash usally uses twips instead of
pixels for a higher solution, as it only accepts integer values.

param: float $pointValue
return: float

deModifyCoordinate( $pointValue )   X-Ref
Demodifies a coordinate value, as flash usally uses twips instead of
pixels for a higher solution, as it only accepts integer values.

param: float $pointValue
return: float

drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. )   X-Ref
Draws a single polygon.

param: array $points Point array
param: ezcGraphColor $color Polygon color
param: mixed $filled Filled
param: float $thickness Line thickness
return: void

drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. )   X-Ref
Draws a line

param: ezcGraphCoordinate $start Start point
param: ezcGraphCoordinate $end End point
param: ezcGraphColor $color Line color
param: float $thickness Line thickness
return: void

getTextBoundings( $size, ezcGraphFontOptions $font, $text )   X-Ref
Returns boundings of text depending on the available font extension

param: float $size Textsize
param: ezcGraphFontOptions $font Font
param: string $text Text
return: ezcGraphBoundings Boundings of text

drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null )   X-Ref
Writes text in a box of desired size

param: string $string Text
param: ezcGraphCoordinate $position Top left position
param: float $width Width of text box
param: float $height Height of text box
param: int $align Alignement of text
param: ezcGraphRotation $rotation
return: void

renderText( $id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null )   X-Ref
Render text depending of font type and available font extensions

param: string $id
param: string $text
param: string $chars
param: int $type
param: string $path
param: ezcGraphColor $color
param: ezcGraphCoordinate $position
param: float $size
param: float $rotation
return: void

drawAllTexts()   X-Ref
Draw all collected texts

The texts are collected and their maximum possible font size is
calculated. This function finally draws the texts on the image, this
delayed drawing has two reasons:

1) This way the text strings are always on top of the image, what
results in better readable texts
2) The maximum possible font size can be calculated for a set of texts
with the same font configuration. Strings belonging to one chart
element normally have the same font configuration, so that all texts
belonging to one element will have the same font size.

return: void

drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true )   X-Ref
Draws a sector of cirlce

param: ezcGraphCoordinate $center Center of circle
param: mixed $width Width
param: mixed $height Height
param: mixed $startAngle Start angle of circle sector
param: mixed $endAngle End angle of circle sector
param: ezcGraphColor $color Color
param: mixed $filled Filled
return: void

simulateCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled )   X-Ref
Draws a circular arc consisting of several minor steps on the bounding
lines.

param: ezcGraphCoordinate $center
param: mixed $width
param: mixed $height
param: mixed $size
param: mixed $startAngle
param: mixed $endAngle
param: ezcGraphColor $color
param: bool $filled
return: string Element id

drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true )   X-Ref
Draws a circular arc

param: ezcGraphCoordinate $center Center of ellipse
param: integer $width Width of ellipse
param: integer $height Height of ellipse
param: integer $size Height of border
param: float $startAngle Starting angle of circle sector
param: float $endAngle Ending angle of circle sector
param: ezcGraphColor $color Color of Border
param: bool $filled
return: void

drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true )   X-Ref
Draw circle

param: ezcGraphCoordinate $center Center of ellipse
param: mixed $width Width of ellipse
param: mixed $height height of ellipse
param: ezcGraphColor $color Color
param: mixed $filled Filled
return: void

drawImage( $file, ezcGraphCoordinate $position, $width, $height )   X-Ref
Draw an image

The image will be inlined in the SVG document using data URL scheme. For
this the mime type and base64 encoded file content will be merged to
URL.

param: mixed $file Image file
param: ezcGraphCoordinate $position Top left position
param: float $width Width of image in destination image
param: float $height Height of image in destination image
return: void

getMimeType()   X-Ref
Return mime type for current image format

return: string

render( $file )   X-Ref
Finally save image

param: string $file Destination filename
return: void

getResource()   X-Ref
Get resource of rendered result

Return the resource of the rendered result. You should not use this
method before you called either renderToOutput() or render(), as the
image may not be completely rendered until then.

return: SWFMovie



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