Ajout gestion des lignes dans les graphiques histogrammes

This commit is contained in:
Michael RICOIS 2010-06-28 10:12:36 +00:00
parent d52a3b7e03
commit bf9c2048e4

View File

@ -324,6 +324,7 @@ function commentaires_graph_histo($id, $titre, $strRatios){
$data['y'][] = array(
'titre' => $titreRatio,
'data' => commentaires_graph_y($typeRatio, $numRatio),
'style' => $matches[3],
);
}
}
@ -367,26 +368,43 @@ function commentaires_graph_histo($id, $titre, $strRatios){
$labelsX[] = $annee;
}
$layer = $c->addBarLayer2(Side);
$layer->setBorderColor(Transparent, softLighting(Left));
//Application layer pour bar
$barLayer = $c->addBarLayer2(Side);
$barLayer->setBorderColor(Transparent, softLighting(Left));
//Application layer pour line
$lineLayer = $c->addLineLayer2(Side);
$lineLayer->setBorderColor(Transparent, softLighting(Left));
$lineLayer->setLineWidth(2);
FB::log($data,'histo-Data');
$i = 0;
foreach($data['y'] as $ydata){
FB::log($couleurs[$i], 'Couleur');
$layer->addDataSet($ydata['data'], $couleurs[$i], $ydata['titre']);
if ( $ydata['style'] == 'H' ){
$barLayer->addDataSet($ydata['data'], $couleurs[$i], $ydata['titre']);
} else if ( $ydata['style'] == 'L' ){
$lineLayer->addDataSet($ydata['data'], $couleurs[$i], $ydata['titre']);
}
$i++;
}
$c->xAxis->setLabels($labelsX);
if( $c->makeChart($path.$file) === true ){
$output = $file;
}
else{
} else {
$output = false;
}
}
return $output;
}
function commentaires_graph_radar($id, $titre, $strRatios){
function commentaires_graph_radar($id, $titre, $strRatios) {
global $graphCouleurs;
if(count($graphCouleurs)>0){
$couleurs = $graphCouleurs;
} else {
$couleurs = array(0x9999ff);
}
FB::log($couleurs, 'RADAR-couleur');
$ratios = explode(',', $strRatios);
$data = array();
$pattern = '/(Rs?)\[(.*)]#(.{1})/';
@ -433,11 +451,11 @@ function commentaires_graph_radar($id, $titre, $strRatios){
}
$c = new PolarChart(548, 480);
$c->setPlotArea(270, 240, 150);
$c->addAreaLayer($gdata, 0x9999ff);
$c->addAreaLayer($gdata, $couleurs[0]);
$c->angularAxis->setLabels($labels);
if( $c->makeChart($path.$file) === true ){
$output = $file;
}else{
} else {
$output = false;
}
return $output;