2009-05-28 14:40:58 +00:00
|
|
|
|
<?php
|
2009-06-15 14:52:23 +00:00
|
|
|
|
|
|
|
|
|
require_once realpath(dirname(__FILE__)).'/functions.php';
|
|
|
|
|
|
2009-06-12 16:48:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* Retourne un tableau de donn<EFBFBD>es format<EFBFBD>s pour les graphiques.
|
|
|
|
|
* @param array $bilansInfo
|
|
|
|
|
* Le tableau des bilans
|
|
|
|
|
* @param array $ratiosEntrep
|
|
|
|
|
* Le tableau des ratios entreprise
|
|
|
|
|
* @param array $tabRatioGraph
|
|
|
|
|
* Un tableau des ratios <EFBFBD> utiliser pour le graphique g<EFBFBD>n<EFBFBD>ral
|
|
|
|
|
* @param array $tabRatioGraphEvol
|
|
|
|
|
* Un tableau des ratios <EFBFBD> utiliser pour les graphiques d'<EFBFBD>volution
|
|
|
|
|
* @return array
|
2009-06-15 14:52:23 +00:00
|
|
|
|
* Retourne un tableau structur<EFBFBD> compos<EFBFBD> de dataGraph, et de dataEvol.
|
2009-06-18 13:22:31 +00:00
|
|
|
|
*/
|
2009-06-15 14:52:23 +00:00
|
|
|
|
function synthese_datagraph($bilansInfos, $ratiosEntrep, $tabRatioGraph, $tabRatioGraphEvol){
|
2009-06-16 07:47:53 +00:00
|
|
|
|
global $firephp;
|
2009-06-15 14:52:23 +00:00
|
|
|
|
$dataGraph = array();
|
|
|
|
|
$dataEvol = array();
|
|
|
|
|
|
|
|
|
|
$nbrAnnees = count($bilansInfos)-1;
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($bilansInfos as $dateCloture){
|
|
|
|
|
//Donn<6E>es pour le graphique
|
|
|
|
|
if(isset($dateCloture['dateCloture'])){
|
|
|
|
|
$dataGraph[$i]['date'] = $dateCloture['dateCloture'];
|
|
|
|
|
foreach($tabRatioGraph as $item){
|
|
|
|
|
$dataGraph[$i][$item['ratio']] = $ratiosEntrep[$i][$item['ratio']]/$item['op'];
|
2009-06-18 13:22:31 +00:00
|
|
|
|
}
|
2009-06-15 14:52:23 +00:00
|
|
|
|
}
|
|
|
|
|
//Donn<6E>es pour les graphiques <20>volutions
|
|
|
|
|
if(isset($bilansInfos[$nbrAnnees-$i]['dateCloture'])){
|
2009-06-16 07:47:53 +00:00
|
|
|
|
foreach($tabRatioGraphEvol as $ratio => $info){
|
|
|
|
|
$dataEvol[$ratio][] = array(
|
2009-06-15 14:52:23 +00:00
|
|
|
|
'date'=>$bilansInfos[$nbrAnnees-$i]['dateCloture'],
|
2009-06-16 07:47:53 +00:00
|
|
|
|
'value'=>(($ratiosEntrep[$nbrAnnees-$i][$ratio]!='NS') ? $ratiosEntrep[$nbrAnnees-$i][$ratio]/$info['op'] : 0 )
|
2009-06-15 14:52:23 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$i++;
|
|
|
|
|
}
|
2009-06-15 14:52:23 +00:00
|
|
|
|
return array("graph" => $dataGraph, "evol" => $dataEvol);
|
|
|
|
|
}
|
2009-05-28 14:40:58 +00:00
|
|
|
|
|
|
|
|
|
|
2009-06-15 14:52:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* Formatte cha<EFBFBD>ne contenant la date format<EFBFBD>.
|
|
|
|
|
* @param array $bilansInfo
|
|
|
|
|
* Le tableau des bilans
|
|
|
|
|
* @param array $nAnnee
|
|
|
|
|
* Le num<EFBFBD>ro de l'ann<EFBFBD>e
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne la date format<EFBFBD>.
|
2009-06-18 13:22:31 +00:00
|
|
|
|
*/
|
2009-06-15 14:52:23 +00:00
|
|
|
|
function synthese_formatdateCloture($bilansInfos, $nAnnee){
|
|
|
|
|
if(isset($bilansInfos[$nAnnee]['dateCloture'])) {
|
|
|
|
|
print substr($bilansInfos[$nAnnee]['dateCloture'],6,2).'/'.substr($bilansInfos[$nAnnee]['dateCloture'],4,2).'/'.substr($bilansInfos[$nAnnee]['dateCloture'],0,4).'<br/>'.$bilansInfos[$nAnnee]['duree'].' mois';
|
|
|
|
|
}else{ print '-'; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2009-06-18 13:22:31 +00:00
|
|
|
|
* Retourne une cha<EFBFBD>ne contenant les ligne d'un tableau html.
|
2009-06-15 14:52:23 +00:00
|
|
|
|
* @param array $ratiosInfos
|
2009-06-18 13:22:31 +00:00
|
|
|
|
* Le tableau des informations ratios
|
2009-06-15 14:52:23 +00:00
|
|
|
|
* @param array $dataEvol
|
|
|
|
|
* Le tableau des donn<EFBFBD>es <EFBFBD>volution
|
|
|
|
|
* @param array $tabRatio
|
2009-06-18 13:22:31 +00:00
|
|
|
|
* Un tableau des ratios <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les lignes
|
2009-06-15 14:52:23 +00:00
|
|
|
|
* @return string
|
|
|
|
|
* Retourne une cha<EFBFBD>ne.
|
2009-06-18 13:22:31 +00:00
|
|
|
|
*/
|
|
|
|
|
function synthese_tablerow($ratiosInfos, $dataEvol, $tabRatio){
|
2009-06-16 07:47:53 +00:00
|
|
|
|
global $firephp;
|
2009-06-15 14:52:23 +00:00
|
|
|
|
$row = '';
|
|
|
|
|
foreach($tabRatio as $ratio => $info){
|
|
|
|
|
$row.= '<tr>'."\n".
|
2009-06-18 13:22:31 +00:00
|
|
|
|
' <td class="head"><a tooltip="'.wrapComment($ratiosInfos[$ratio]['commentaires']).'">'.$info['titre'].'</a></td>'."\n".
|
2009-06-15 14:52:23 +00:00
|
|
|
|
' <td class="right">'.dRatio(2,$ratio).'</td>'."\n".
|
|
|
|
|
' <td class="right">'.dRatio(1,$ratio).'</td>'."\n".
|
|
|
|
|
' <td class="right">'.dEvol(1,$info['evol']).'</td>'."\n".
|
|
|
|
|
' <td class="right">'.dRatio(0,$ratio).'</td>'."\n".
|
|
|
|
|
' <td class="right">'.dEvol(0,$info['evol']).'</td>'."\n";
|
2009-06-18 13:22:31 +00:00
|
|
|
|
|
|
|
|
|
if(count($tabRatio)!=1){
|
|
|
|
|
$class = 'class="jTip"';
|
|
|
|
|
$href='/?page=synthese&siret='.$_REQUEST['siret'].'&idEntreprise='.$_REQUEST['idEntreprise'].'&ratio='.$ratio;
|
|
|
|
|
$rel=synthese_graphEvol($dataEvol[$ratio]);
|
2009-06-15 14:52:23 +00:00
|
|
|
|
}else{
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$class = '';
|
|
|
|
|
$href='#';
|
|
|
|
|
$ref='';
|
|
|
|
|
}
|
|
|
|
|
$row.= ' <td><a '.$class.' href="'.$href.'" rel="'.$rel;
|
|
|
|
|
if(isset($info['unite']) && $info['unite']==1){
|
|
|
|
|
$row.= '&unite='.$ratiosInfos[$info['evol']]['unite'];
|
2009-06-15 14:52:23 +00:00
|
|
|
|
}
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$row.= '" name="'.$info['titre'].'"><img src="./img/synthese/chart_bar.png" alt="Visionner le graphique"></a></td>'."\n";
|
|
|
|
|
$row.= '</tr>'."\n";
|
2009-06-15 14:52:23 +00:00
|
|
|
|
}
|
|
|
|
|
return $row;
|
|
|
|
|
}
|
2009-05-28 14:40:58 +00:00
|
|
|
|
|
2009-06-18 13:22:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* Retourne l'url de la page d'appel du graphique avec tous ces param<EFBFBD>tres.
|
|
|
|
|
* @param array $data
|
|
|
|
|
* Les donn<EFBFBD>es du tableau
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne une cha<EFBFBD>ne.
|
|
|
|
|
*/
|
|
|
|
|
function synthese_graphEvol($data, $img = FALSE){
|
|
|
|
|
$url = './pages/synthese_dgraph.php';
|
|
|
|
|
$width = 375;
|
|
|
|
|
$data = urlencode(serialize($data));
|
|
|
|
|
return $url.'?width='.$width.'&data='.$data;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-16 07:47:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* Retourne une cha<EFBFBD>ne contenant la ligne d'un tableau html.
|
|
|
|
|
* @param array $ratiosInfos
|
|
|
|
|
* Le tableau des information ratios
|
|
|
|
|
* @param array $dataEvol
|
|
|
|
|
* Le tableau des donn<EFBFBD>es <EFBFBD>volution
|
|
|
|
|
* @param array $tabRatio
|
|
|
|
|
* Un tableau des ratios <EFBFBD> utiliser pour le g<EFBFBD>n<EFBFBD>rer les lignes
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne une cha<EFBFBD>ne.
|
2009-06-18 13:22:31 +00:00
|
|
|
|
*/
|
|
|
|
|
function ratios_tablerow($ratiosInfos, $tabRatio, $bilan, $ratio = ''){
|
|
|
|
|
|
2009-06-16 07:47:53 +00:00
|
|
|
|
foreach($tabRatio as $item){
|
2009-06-18 13:22:31 +00:00
|
|
|
|
if($ratio==''){
|
2009-06-16 07:47:53 +00:00
|
|
|
|
if(isset($item['ratio'])){
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$row.= '<tr>'."\n";
|
|
|
|
|
$row.= ' <td><a tooltip="'.wrapComment($ratiosInfos[$item['ratio']]['commentaires']).'">'.$item['titre'].'<br/>'.$item['stitre'].'</a></td>'."\n";
|
|
|
|
|
$row.= ' <td class="right">'.dRatio($bilan,$item['ratio']).'</td>'."\n";
|
|
|
|
|
$row.= ' <td class="right">'.dSecteur($bilan,$item['ratio']).'</td>'."\n";
|
|
|
|
|
$row.= ' <td class="position">';
|
2009-06-23 15:16:21 +00:00
|
|
|
|
$row.= '<a class="jTip" href="/?page=ratios&siret='.$_REQUEST['siret'].'&idEntreprise='.$_REQUEST['idEntreprise'].'&ratio='.$item['ratio'].'" rel="./pages/ratios_dgraph.php?width=375&f='.ratios_graph($item['ratio'], dGraph($item['ratio'])).'" name="'.$item['titre'].'">'."\n";
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$row.= dPosition($bilan,$item['ratio'],'>');
|
|
|
|
|
$row.= '</a>';
|
|
|
|
|
$row.= '</td>'."\n";
|
|
|
|
|
$row.= '</tr>'."\n";
|
2009-06-16 07:47:53 +00:00
|
|
|
|
}else{
|
2009-06-18 13:22:31 +00:00
|
|
|
|
$row.= '<tr class="subhead">'."\n";
|
|
|
|
|
$row.= ' <td class="center italique">'.$item['titre'].'</td>'."\n";
|
|
|
|
|
$row.= ' <td>Entreprise</td>'."\n";
|
|
|
|
|
$row.= ' <td>Secteur</td>'."\n";
|
|
|
|
|
$row.= ' <td>Position</td>'."\n";
|
|
|
|
|
$row.= '</tr>'."\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}elseif($ratio==$item['ratio']){
|
2009-06-16 07:47:53 +00:00
|
|
|
|
$row.= '<tr class="subhead">'."\n".
|
|
|
|
|
' <td class="center italique">'.$tabRatio[$item['parent']]['titre'].'</td>'."\n".
|
|
|
|
|
' <td>Entreprise</td>'."\n".
|
|
|
|
|
' <td>Secteur</td>'."\n".
|
|
|
|
|
' <td>Position</td>'."\n".
|
2009-06-18 13:22:31 +00:00
|
|
|
|
'</tr>'."\n";
|
2009-06-16 07:47:53 +00:00
|
|
|
|
$row.= '<tr>'."\n".
|
|
|
|
|
' <td><a tooltip="'.wrapComment($ratiosInfos[$item['ratio']]['commentaires']).'">'.$item['titre'].'<br/>'.$item['stitre'].'</a></td>'."\n".
|
|
|
|
|
' <td class="right">'.dRatio($bilan,$item['ratio']).'</td>'."\n".
|
|
|
|
|
' <td class="right">'.dSecteur($bilan,$item['ratio']).'</td>'."\n".
|
|
|
|
|
' <td class="position">'."\n".
|
2009-06-18 13:22:31 +00:00
|
|
|
|
' <a href="#" name="'.$item['titre'].'">'."\n".
|
2009-06-16 07:47:53 +00:00
|
|
|
|
dPosition($bilan,$item['ratio'],'>')."\n".
|
|
|
|
|
' </a>'."\n".
|
|
|
|
|
' </td>'."\n".
|
|
|
|
|
'</tr>'."\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $row;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-23 06:54:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Enregistre le graphique bilan actif sous forme d'image.
|
|
|
|
|
* @param array $data
|
|
|
|
|
* Tableau structur<EFBFBD> des donn<EFBFBD>es
|
|
|
|
|
* @param array $filename
|
|
|
|
|
* Le nom de fichier g<EFBFBD>n<EFBFBD>r<EFBFBD>
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne un message d'erreur ou le code HTML d'affichage.
|
|
|
|
|
*/
|
|
|
|
|
function bilans_graph_actif($data, $filename){
|
|
|
|
|
require_once 'phpchartdir/phpchartdir.php';
|
|
|
|
|
$w = 570;
|
|
|
|
|
$h = 210;
|
|
|
|
|
$x = round($w/2);
|
|
|
|
|
$y = round($h/2);
|
|
|
|
|
$radius=90;
|
|
|
|
|
$c = new PieChart($w, $h);
|
|
|
|
|
$labels = array('Immo. incorporelles',
|
|
|
|
|
'Immo. corporelles',
|
|
|
|
|
'Immo. financi<63>res',
|
|
|
|
|
'Stock et encours',
|
|
|
|
|
'Cr<43>ances Clients',
|
|
|
|
|
'Autres cr<63>ances',
|
|
|
|
|
'Tr<54>sorerie Active');
|
|
|
|
|
$textBoxObj = $c->addTitle("Composition de l'actif", "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);
|
|
|
|
|
$path = PATH_SITE.'/cache/imgcache/';
|
|
|
|
|
$file = $filename.'-graph-bilansactif.png';
|
|
|
|
|
if($c->makeChart($path.$file) === TRUE){
|
|
|
|
|
$return = '<img src="./imgcache/'.$file.'"/>';
|
|
|
|
|
}else{
|
|
|
|
|
$return = 'Impossible de g<>n<EFBFBD>rer le graphique';
|
|
|
|
|
}
|
|
|
|
|
return $return;
|
|
|
|
|
}
|
2009-06-16 07:47:53 +00:00
|
|
|
|
|
2009-06-23 06:54:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Enregistre le graphique bilan SIG sous forme d'image.
|
|
|
|
|
* @param array $data
|
|
|
|
|
* Tableau structur<EFBFBD> des donn<EFBFBD>es
|
|
|
|
|
* @param array $filename
|
|
|
|
|
* Le nom de fichier g<EFBFBD>n<EFBFBD>r<EFBFBD>
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne un message d'erreur ou le code HTML d'affichage.
|
|
|
|
|
*/
|
|
|
|
|
function bilans_graph_sig($data, $filename){
|
|
|
|
|
require_once 'phpchartdir/phpchartdir.php';
|
|
|
|
|
$w = 570;
|
|
|
|
|
$h = 210;
|
|
|
|
|
$x = round($w/2);
|
|
|
|
|
$y = round($h/2);
|
|
|
|
|
$radius=70;
|
|
|
|
|
$c = new PieChart($w, $h);
|
|
|
|
|
$labels = array('Achats de marchandises.',
|
|
|
|
|
'Autres achats externes',
|
|
|
|
|
'Charges de fonctionnement',
|
|
|
|
|
'Amortissement et provisions',
|
|
|
|
|
'Perte financi<63>re',
|
|
|
|
|
'Imp<6D>ts soci<63>t<EFBFBD>s',
|
|
|
|
|
'R<>SULTAT NET',
|
|
|
|
|
);
|
|
|
|
|
$textBoxObj = $c->addTitle("Solde Interm<72>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);
|
|
|
|
|
$c->setLineColor(SameAsMainColor, 0x000000);
|
|
|
|
|
$c->setLabelFormat("<*block,valign=absmiddle*>{label} <*font=arial.ttf,size=0*>({percent|0}%)");
|
|
|
|
|
$c->setStartAngle(135);
|
|
|
|
|
$c->setData($data, $labels);
|
|
|
|
|
$c->set3D(20);
|
|
|
|
|
$path = PATH_SITE.'/cache/imgcache/';
|
|
|
|
|
$file = $filename.'-graph-bilanssig.png';
|
|
|
|
|
if($c->makeChart($path.$file) === TRUE){
|
|
|
|
|
$return = '<img src="./imgcache/'.$file.'"/>';
|
|
|
|
|
}else{
|
|
|
|
|
$return = 'Impossible de g<>n<EFBFBD>rer le graphique';
|
|
|
|
|
}
|
|
|
|
|
return $return;
|
|
|
|
|
}
|
2009-06-16 07:47:53 +00:00
|
|
|
|
|
2009-06-23 06:54:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Enregistre le graphique bilan passif sous forme d'image.
|
|
|
|
|
* @param array $data
|
|
|
|
|
* Tableau structur<EFBFBD> des donn<EFBFBD>es
|
|
|
|
|
* @param array $filename
|
|
|
|
|
* Le nom de fichier g<EFBFBD>n<EFBFBD>r<EFBFBD>
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne un message d'erreur ou le code HTML d'affichage.
|
|
|
|
|
*/
|
|
|
|
|
function bilans_graph_passif($data, $filename){
|
|
|
|
|
require_once 'phpchartdir/phpchartdir.php';
|
|
|
|
|
$w = 570;
|
|
|
|
|
$h = 210;
|
|
|
|
|
$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<63>res',
|
|
|
|
|
'Dettes Fournisseurs',
|
|
|
|
|
'Dettes fiscales',
|
|
|
|
|
'Autres Dettes',
|
|
|
|
|
'Tr<54>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);
|
|
|
|
|
$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);
|
|
|
|
|
$path = PATH_SITE.'/cache/imgcache/';
|
|
|
|
|
$file = $filename.'-graph-bilanspassif.png';
|
|
|
|
|
if($c->makeChart($path.$file) === TRUE){
|
|
|
|
|
$return = '<img src="./imgcache/'.$file.'"/>';
|
|
|
|
|
}else{
|
|
|
|
|
$return = 'Impossible de g<>n<EFBFBD>rer le graphique';
|
|
|
|
|
}
|
|
|
|
|
return $return;
|
|
|
|
|
}
|
2009-06-23 15:16:21 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enregistre le graphique <EFBFBD>volution.
|
|
|
|
|
* @param array $data
|
|
|
|
|
* Tableau structur<EFBFBD> des donn<EFBFBD>es
|
|
|
|
|
* @param array $filename
|
|
|
|
|
* Le nom de fichier g<EFBFBD>n<EFBFBD>r<EFBFBD>
|
|
|
|
|
* @return string
|
|
|
|
|
* Retourne un message d'erreur ou le code HTML d'affichage.
|
|
|
|
|
*/
|
|
|
|
|
function ratios_graph($ratio, $data){
|
|
|
|
|
|
|
|
|
|
require_once 'phpchartdir/phpchartdir.php';
|
|
|
|
|
if(count($data)<=1){
|
|
|
|
|
$return = 0;
|
|
|
|
|
}else{
|
|
|
|
|
foreach($data['data'] as $value){
|
|
|
|
|
$dataX1[] = $value['entreprise'];
|
|
|
|
|
$dataX2[] = $value['secteur'];
|
|
|
|
|
$labelsX[] = substr($value['date'],0,4);
|
|
|
|
|
}
|
|
|
|
|
$i=-100; while($i>100){ $labelsY[] = $i;}
|
|
|
|
|
$c = new XYChart(350, 250);
|
|
|
|
|
$c->setPlotArea(55, 10, 280, 200);
|
|
|
|
|
$c->yAxis->setTitle($data['unite']);
|
|
|
|
|
$c->xAxis->setTitle("Ann<EFBFBD>es");
|
|
|
|
|
$c->xAxis->setWidth(2);
|
|
|
|
|
$c->yAxis->setWidth(2);
|
|
|
|
|
$legendObj = $c->addLegend(50, 10, false, "times.ttf", 9);
|
|
|
|
|
$legendObj->setBackground(Transparent);
|
|
|
|
|
$c->addLineLayer($dataX1, 0x0000ff, "Entreprise");
|
|
|
|
|
$c->addLineLayer($dataX2, 0x008C00, "Secteur");
|
|
|
|
|
$c->yAxis->setLabels($labelsY);
|
|
|
|
|
$c->yAxis->setLabelStep(10);
|
|
|
|
|
$c->xAxis->setLabels($labelsX);
|
|
|
|
|
$path = PATH_SITE.'/cache/imgcache/';
|
|
|
|
|
$file = 'ratios-'.$ratio.'.png';
|
|
|
|
|
if($c->makeChart($path.$file) === TRUE){ $return = $file; }
|
|
|
|
|
else{ $return = FALSE; }
|
|
|
|
|
}
|
|
|
|
|
return $return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-28 14:40:58 +00:00
|
|
|
|
?>
|