2011-05-16 15:53:31 +00:00

42 lines
1.6 KiB
PHP

<?php
require_once ('ChartDirector/phpchartdir.php');
Class Zend_View_Helper_PassifGraph extends Zend_View_Helper_Abstract
{
public function PassifGraph($data, $siren, $url)
{
$filename = $siren;
$file = $filename.'-graph-passif.png';
$w = 660;
$h = 243;
$x = round($w/2);
$y = round($h/2);
$radius = 90;
$c = new PieChart($w, $h);
$labels = array('Fonds propres',
'Provisions Risques',
'Compte Courant',
'Dettes Financières',
'Dettes Fournisseurs',
'Dettes fiscales',
'Autres Dettes',
'Trésorerie Passive'
);
$textBoxObj = $c->addTitle("Composition du passif", "timesbi.ttf", 15);
$c->setPieSize($x, $y, $radius);
$c->setLabelLayout(SideLayout);
$t = $c->setLabelStyle();
$t->setBackground(SameAsMainColor, Transparent, glassEffect());
$t->setRoundedCorners(5);
# Set the border color of the sector the same color as the fill color. Set the line # color of the join line to black (0x0)
$c->setLineColor(SameAsMainColor, 0x000000);
$c->setStartAngle(135);
$c->setLabelFormat("<*block,valign=absmiddle*>{label} <*font=timesbi.ttf,size=0*>({percent|0}%)");
$c->setData($data, $labels);
$c->set3D(20);
$chart1URL = $c->makeSession("chart1");
$imageMap = $c->getHTMLImageMap("", "", "name='{label}' title='<b>{label}</b><br />{value|0} K.Euros' class='detailsgraphique'");
echo '<img src="/fichier/imgcache/'.$file.'?'.$chart1URL.'" border="1" usemap="#map2"><map name="map2">'.$imageMap.'</map>';
echo '<map name="map2">'.$imageMap.'</map>';
}
}