Class Xml2PdfTag_graph

Description

<graph> tag.

The tag <graph> is used to draw graph in the document. The differents graph type are defined using plugins. For each graph type a plugin file must exist into the plugin grap path (define in the config file), it must be named xml2pdf_graph_mycustomgraphtype.php and must contain a class named xml2pdf_graph_mycustomgraphtype.

The existing plugins are :

  1. <!-- Draw a circle graph whith five portions -->
  2. <graph type='circle' width='100' height='80' mode='3D' legend='%l (%p)' fontsize='10'>
  3.     <value legend='Lille' data='1510' color='#f0f5ff'/>
  4.     <value legend='Paris' data='1610' color='#feefc1'/>
  5.     <value legend='Toulouse' data='1400' color='#ffaaaa'/>
  6.     <value legend='Lyon' data='700'/>
  7.     <value legend='Bordeaux' data='1001'/>
  8. </graph>

Located in /plugins/tags/xml2pdf.tag.graph.php (line 46)

Xml2PdfTag
   |
   --Xml2PdfTag_graph
Variable Summary
 string $color
 array $colors
 array $data
 integer $fontSize
 float $height
 float $left
 string $legendFormat
 array $legends
 float $legendWidth
 integer $maxValRepere
 string $mode
 integer $nbIndRepere
 integer $nbVal
 float $sum
 float $top
 string $type
 float $width
Method Summary
 void __construct (object Pdf $pdf, array $attributes)
 void close ()
 void sector (integer $xc, integer $yc,  $r, integer $a, integer $b, [string $color = '#ffffff'], [string $style = 'FD'], [boolean $cw = true], [integer $o = 90])
 void setLegends ()
 void _arc (integer $x1, integer $y1, integer $x2, integer $y2, integer $x3, integer $y3)
 boolean _drawGraph ()
Variables
string $color = null (line 71)

main color.

  • access: public
array $colors = array() (line 143)

values colors.

  • access: public
array $data = array() (line 149)

graph datas.

  • access: public
integer $fontSize = 8 (line 89)

font size.

  • access: public
float $height = 0 (line 107)

graph height.

  • access: public
float $left = 0 (line 119)

left margin.

  • access: public
string $legendFormat = '%l' (line 65)

legend format.

  • access: public
array $legends = array() (line 137)

values legends.

  • access: public
float $legendWidth = 0 (line 113)

legend width.

  • access: public
integer $maxValRepere = 0 (line 77)

max scale value.

  • access: public
string $mode = '2D' (line 59)

visual effect.

  • access: public
integer $nbIndRepere = 4 (line 83)

number of values of the scale.

  • access: public
integer $nbVal = 0 (line 95)

number of values.

  • access: public
float $sum = 0 (line 131)

sum of the graph values.

  • access: public
float $top = 0 (line 125)

top margin.

  • access: public
string $type = 'hbar' (line 53)

graph type.

  • access: public
float $width = 0 (line 101)

graph width.

  • access: public

Inherited Variables

Inherited from Xml2PdfTag

Xml2PdfTag::$content
Xml2PdfTag::$pdf
Methods
Constructor __construct (line 161)

Constructor.

  • access: public
void __construct (object Pdf $pdf, array $attributes)
  • object Pdf $pdf: object Pdf
  • array $attributes: tag properties

Redefinition of:
Xml2PdfTag::__construct()
Constructor.
close (line 222)

Close the tag.

  • access: public
void close ()

Redefinition of:
Xml2PdfTag::close()
Close tag.
sector (line 305)

Draw a circle sector.

  • access: public
void sector (integer $xc, integer $yc,  $r, integer $a, integer $b, [string $color = '#ffffff'], [string $style = 'FD'], [boolean $cw = true], [integer $o = 90])
  • integer $xc: center abscis
  • integer $yc: center ordonnate
  • integer $a: begin angle (degree)
  • integer $b: end angle (degree)
  • string $color: fill color
  • string $style: fill style [D(draw)|F(fill)|FD|DF]
  • boolean $cw: rotate wise (true: clock wise, false: counter clock wise)
  • integer $o: origine angle (0 to right, 90 to top, 180 to left, 270 to bottom)
  • $r
setLegends (line 237)

Build the graph legend.

  • access: public
void setLegends ()
_arc (line 405)

Draw an arc of circle

  • access: private
void _arc (integer $x1, integer $y1, integer $x2, integer $y2, integer $x3, integer $y3)
  • integer $x1: center absciss
  • integer $y1: center ordonnate
  • integer $x2: start point absciss
  • integer $y2: start point ordonnate
  • integer $x3: end poinf absciss
  • integer $y3: end point ordonnate
_drawGraph (line 267)

Build the graph using appropriate plugin.

Instantiate the plugin graph class to render the graph.

  • access: private
boolean _drawGraph ()

Inherited Methods

Inherited From Xml2PdfTag

 Xml2PdfTag::__construct()
 Xml2PdfTag::addContent()
 Xml2PdfTag::close()

Documentation generated on Wed, 11 Oct 2006 22:27:22 +0200 by phpDocumentor 1.3.0