2011-05-17 06:14:37 +00:00

41 lines
1.6 KiB
PHP

<?php
require_once ('ChartDirector/phpchartdir.php');
Class Zend_View_Helper_SigGraph extends Zend_View_Helper_Abstract
{
public function SigGraph($data, $siren, $url)
{
$filename = $siren;
$file = $filename.'-graph-sig.png';
$w = 660;
$h = 243;
$x = round($w/2);
$y = round($h/2);
$radius = 90;
$c = new PieChart($w, $h);
$labels = array('Achats de marchandises.',
'Autres achats externes',
'Charges de fonctionnement',
'Amortissement et provisions',
'Perte financière',
'Impôts sociétés',
'RÉSULTAT NET',
);
$textBoxObj = $c->addTitle("Solde intermédiaire de gestion", "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'");
$c->makeChart('../cache/pages/imgcache/'.$file);
echo '<img src="/fichier/imgcache/'.$file.'?'.$chart1URL.'" border="1" usemap="#map3"><map name="map3">'.$imageMap.'</map>';
echo '<map name="map3">'.$imageMap.'</map>';
}
}