Source for file xml2pdf.graph.circle.php
Documentation is available at xml2pdf.graph.circle.php
* Xml2Pdf circle graph plugin file
* @author guillaume l. <guillaume@geelweb.org>
* @link http://www.geelweb.org geelweb-dot-org
* @license http://opensource.org/licenses/bsd-license.php BSD License
* @copyright copytight © 2006, guillaume luchet
* plugin class xml2pdf_graph_circle
* <graph type='circle' width='100' height='80' mode='3D' legend='%l (%p)' fontsize='10'>
* <value legend='Lille' data='1510' color='#f0f5ff'/>
* <value legend='Paris' data='1610' color='#feefc1'/>
* <value legend='Toulouse' data='1400' color='#ffaaaa'/>
* <value legend='Lyon' data='700'/>
* <value legend='Bordeaux' data='1001'/>
* @author guillaume l. <guillaume@geelweb.org>
* @link http://www.geelweb.org geelweb-dot-org
* @license http://opensource.org/licenses/bsd-license.php BSD License
* @copyright copytight © 2006, guillaume luchet
* @tutorial Xml2Pdf/Xml2Pdf.Graph.circle.pkg
// xml2pdf_graph_circle::__construct() {{{
* @param Object $graph Object Xml2Pdf_Tag_graph
$graph->pdf->SetFont('Courier', '', $graph->fontSize);
$XPage =
$graph->pdf->GetX();
$YPage =
$graph->pdf->GetY();
$rayon =
min($graph->width -
$marge *
4 -
$hLegende -
$graph->legendWidth,
$graph->height -
$marge *
2);
$rayon =
floor($rayon /
2);
$XDiag =
$XPage +
$marge +
$rayon;
$YDiag =
$YPage +
$marge +
$rayon;
$graph->pdf->SetLineWidth(0.2);
$loop =
$graph->mode==
'3d'?
4:
1;
for($delta=
0 ; $delta<
$loop ; $delta++
) {
foreach($graph->data as $val) {
$angleFin =
$angleDebut +
$angle;
if($graph->colors[$i] !=
null) {
$tab =
Xml2Pdf::ConvertColor($graph->colors[$i]);
$graph->pdf->SetFillColor($tab['r'],$tab['g'],$tab['b']);
$graph->pdf->SetFillColor($tab['r'],$tab['g'],$tab['b']);
$graph->colors[$i] =
$tab;
if($delta>
0 &&
$delta<
$loop-
1) {
$graph->pdf->SetDrawColor($tab['r'],$tab['g'],$tab['b']);
$graph->pdf->SetDrawColor(0,0,0);
$graph->sector($XDiag, $YDiag-
$delta, $rayon,
$angleDebut, $angleFin,$graph->colors[$i]);
$graph->sector($XDiag, $YDiag-
$delta, $rayon,
$angleDebut -
$angle, 360,
$graph->pdf->SetFont('Courier', '', $graph->fontSize);
$x1 =
$XPage +
2 *
$rayon +
4 *
$marge;
$x2 =
$x1 +
$hLegende +
$marge;
$y1 =
$YDiag -
$rayon +
(2 *
$rayon -
$graph->nbVal*
($hLegende +
$marge)) /
2;
for($i=
0; $i<
$graph->nbVal; $i++
) {
$tab =
Xml2Pdf::ConvertColor($graph->colors[$i]);
$graph->pdf->SetFillColor($tab['r'],$tab['g'],$tab['b']);
$graph->pdf->Rect($x1, $y1, $hLegende, $hLegende, 'DF');
$graph->pdf->SetXY($x2, $y1);
$graph->pdf->Cell(0,$hLegende,$graph->legends[$i]);
$y1 +=
$hLegende +
$marge;
Documentation generated on Wed, 11 Oct 2006 22:27:14 +0200 by phpDocumentor 1.3.0