2011-05-13 16:33:21 +00:00

40 lines
1.4 KiB
PHP

<?php
require_once ('ChartDirector/phpchartdir.php');
Class Zend_View_Helper_SigGraph extends Zend_View_Helper_Abstract
{
public function SigGraph($data, $siren)
{
$filename = $siren;
$file = $filename.'-graph-sig.png';
if(file_exists(APPLICATION_PATH.'/../cache/pages/imgcache/'.$file))
return;
$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);
if (!$c->makeChart('../cache/pages/imgcache/'.$file))
echo 'Impossible de charger le graphique !';
}
}