diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index c2e03394a4c..3c6b3d974c6 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -66,7 +66,7 @@ if (! $mesg) $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); diff --git a/htdocs/comm/propal/stats/month.php b/htdocs/comm/propal/stats/month.php index 2af52938720..4bdde0d74ae 100644 --- a/htdocs/comm/propal/stats/month.php +++ b/htdocs/comm/propal/stats/month.php @@ -75,7 +75,7 @@ if (! $mesg) $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); @@ -111,7 +111,7 @@ if (! $mesg) $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename_amount, $data, $year); @@ -146,7 +146,7 @@ if (! $mesg) $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename_avg); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 8daa1ca656e..befec35edb0 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -86,7 +86,7 @@ if (! $mesg) $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetYLabel($langs->trans("NbOfOrder")); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); diff --git a/htdocs/commande/stats/month.php b/htdocs/commande/stats/month.php index 315ef7d5b44..91ca353fcec 100644 --- a/htdocs/commande/stats/month.php +++ b/htdocs/commande/stats/month.php @@ -83,7 +83,7 @@ if (! $mesg) $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetYLabel($langs->trans("NbOfOrders")); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 6c4afd6ee03..2ee1623658b 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -498,7 +498,7 @@ if ($_GET["account"] || $_GET["ref"]) $px->SetWidth($width); $px->SetHeight($height); $px->SetType('bars'); - $px->SetShading(8); + $px->SetShading(3); $px->setBgColor('onglet'); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index e23edd0e78f..8f59c1dd21c 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -63,7 +63,7 @@ if (! $mesg) $px->SetLegend(array($year - 1, $year)); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); diff --git a/htdocs/compta/facture/stats/month.php b/htdocs/compta/facture/stats/month.php index 046aebd929b..76f2def34cd 100644 --- a/htdocs/compta/facture/stats/month.php +++ b/htdocs/compta/facture/stats/month.php @@ -68,7 +68,7 @@ if (! $mesg) $px->SetPrecisionY(0); $px->SetWidth($GRAPHWIDTH); $px->SetHeight($GRAPHHEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); @@ -96,7 +96,7 @@ if (! $mesg) $px->SetPrecisionY(0); $px->SetWidth($GRAPHWIDTH); $px->SetHeight($GRAPHHEIGHT); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename_amount); diff --git a/htdocs/dolgraph.class.php b/htdocs/dolgraph.class.php index 42ef8da032f..6eb5558134c 100644 --- a/htdocs/dolgraph.class.php +++ b/htdocs/dolgraph.class.php @@ -21,7 +21,7 @@ /** \file htdocs/dolgraph.class.php - \brief Fichier de la classe mère de gestion des graph phplot + \brief Fichier de la classe m�re de gestion des graph phplot \version $Revision$ \remarks Usage: $graph_data = array(array('labelA',yA),array('labelB',yB)); @@ -40,7 +40,7 @@ /** \class Graph - \brief Classe mère permettant la gestion des graph + \brief Classe m�re permettant la gestion des graph */ class DolGraph @@ -80,7 +80,7 @@ class DolGraph global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; - // Test si module GD présent + // Test si module GD pr�sent $modules_list = get_loaded_extensions(); $isgdinstalled=0; foreach ($modules_list as $module) @@ -89,12 +89,12 @@ class DolGraph } if (! $isgdinstalled) { - $this->error="Erreur: Le module GD pour php ne semble pas disponible. Il est requis pour générer les graphiques."; + $this->error="Erreur: Le module GD pour php ne semble pas disponible. Il est requis pour g�n�rer les graphiques."; return -1; } - // Défini propriétés de l'objet graphe + // D�fini propri�t�s de l'objet graphe $this->library=$conf->global->MAIN_GRAPH_LIBRARY; $this->bordercolor = array(235,235,224); @@ -120,7 +120,7 @@ class DolGraph } /** - * \brief Génère le fichier graphique sur le disque + * \brief G�n�re le fichier graphique sur le disque * \param file Nom du fichier image */ function draw($file) @@ -157,9 +157,13 @@ class DolGraph if ($this->type == 'lines') $class='LinePlot'; include_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/".$class.".class.php"; - $group = new PlotGroup; - $group->setPadding(30, 10, NULL, NULL); - + // Definition de couleurs + $bgcolor=new Color($this->bgcolor[0],$this->bgcolor[1],$this->bgcolor[2]); + $colortrans=new Color(0,0,0,100); + $colorsemitrans=new Color(255,255,255,50); + $colorgradient= new LinearGradient(new Color(235, 235, 235),new Color(255, 255, 255),0); + + // Graph $graph = new Graph($this->width, $this->height); $graph->border->hide(); $graph->setAntiAliasing(true); @@ -168,19 +172,18 @@ class DolGraph $graph->title->set($this->title); $graph->title->setFont(new Tuffy(10)); } -/* - if (isset($this->SetShading)) - { - // Ombre ne fonctionne pas. Un Mars a celui qui trouve pourquoi. - $shadow=new Shadow(3); - $shadow->setSize($this->SetShading); - $graph->Shadow=$shadow; - } -*/ +// $graph->setBackgroundColor($bgcolor); + $graph->setBackgroundGradient($colorgradient); + + $group = new PlotGroup; + //$group->setSpace(5, 5, 0, 0); + $group->setPadding(30, 10); + $group->legend->setSpace(0); + $group->legend->setPadding(2,2,2,2); + $group->legend->setPosition(NULL,0.1); + $group->legend->setBackgroundColor($colorsemitrans); + $group->grid->setBackgroundColor($colortrans); - $bgcolor=new Color($this->bgcolor[0],$this->bgcolor[1],$this->bgcolor[2]); - $graph->setBackgroundColor($bgcolor); - //print "dd".sizeof($this->data); // On boucle sur chaque lot de donnees $legends=array(); @@ -198,35 +201,40 @@ class DolGraph $j++; } - /* - print "Lot de donnees $i
"; - print_r($values); - print '
'; - */ - + if ($this->type == 'bars') { - // Artichow ne gère pas les valeurs inconnues - // Donc si inconnu, on la fixe à null + //print "Lot de donnees $i
"; + //print_r($values); + //print '
'; + + // Artichow ne gere pas les valeurs inconnues + // Donc si inconnu, on la fixe a null $newvalues=array(); foreach($values as $val) { $newvalues[]=(is_numeric($val) ? $val : null); } + $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); + $colorborder=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); + //$plot = new BarPlot($newvalues,1,1,0); - $plot = new BarPlot($newvalues); - - $plot->barShadow->setSize(2); - $plot->barShadow->setPosition('Shadow::RIGHT_TOP'); - $plot->barShadow->setColor(new Color(160, 160, 160, 10)); + $plot = new BarPlot($newvalues, $i+1, $nblot); + + $plot->barBorder->setColor($colorborder); + $plot->setBarColor($color); + + $plot->setBarPadding(0.1, 0.1); + $plot->setBarSpace(5); + + $plot->barShadow->setSize($this->SetShading); + $plot->barShadow->setPosition(Shadow::RIGHT_TOP); + $plot->barShadow->setColor(new Color(160, 160, 160, 50)); $plot->barShadow->smooth(TRUE); //$plot->setSize(1, 0.96); //$plot->setCenter(0.5, 0.52); - $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],25); - $plot->setBarColor($color); - // Le mode automatique est plus efficace $plot->SetYMax($this->MaxValue); $plot->SetYMin($this->MinValue); @@ -234,8 +242,8 @@ class DolGraph if ($this->type == 'lines') { - // Artichow ne gère pas les valeurs inconnues - // Donc si inconnu, on la fixe à null + // Artichow ne gere pas les valeurs inconnues + // Donc si inconnu, on la fixe a null $newvalues=array(); foreach($values as $val) { @@ -246,7 +254,7 @@ class DolGraph //$plot->setSize(1, 0.96); //$plot->setCenter(0.5, 0.52); - $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],25); + $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],30); $plot->setColor($color); // Le mode automatique est plus efficace @@ -254,39 +262,33 @@ class DolGraph $plot->SetYMin($this->MinValue); } - $plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce saturés + $plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures if ($nblot >= 2) { - $group->legend->add($plot, $this->Legend[$i], 'Legend::MARK'); - - $group->add($plot); + $group->legend->add($plot, $this->Legend[$i], Legend::BACKGROUND); } else { $plot->xAxis->setLabelText($legends); $plot->xAxis->label->setFont(new Tuffy(7)); - - $graph->add($plot); - } + } + $group->add($plot); $i++; } - if ($nblot >= 2) - { - $group->axis->bottom->setLabelText($legends); - $group->axis->bottom->label->setFont(new Tuffy(7)); + $group->axis->bottom->setLabelText($legends); + $group->axis->bottom->label->setFont(new Tuffy(7)); - $graph->add($group); - } + $graph->add($group); // Generate file $graph->draw($file); } /** - * \brief Génère le fichier graphique sur le disque + * \brief Genere le fichier graphique sur le disque * via la librairie PHPlot 5 ou 4 * \param file Nom du fichier image */ @@ -294,7 +296,7 @@ class DolGraph { dolibarr_syslog("DolGraph.class::draw_phplot this->type=".$this->type); - // Vérifie que chemin vers PHPLOT_PATH est connu et on definie $graphpathdir + // Verifie que chemin vers PHPLOT_PATH est connu et on definie $graphpathdir $graphpathdir=DOL_DOCUMENT_ROOT."/includes/phplot"; if (defined('PHPLOT_PATH')) $graphpathdir=PHPLOT_PATH; if ($conf->global->PHPLOT_PATH) $graphpathdir=$conf->global->PHPLOT_PATH; @@ -388,7 +390,7 @@ class DolGraph // Define title if (isset($this->title)) $graph->SetTitle($this->title); - // Défini position du graphe (et legende) au sein de l'image + // D�fini position du graphe (et legende) au sein de l'image if (isset($this->Legend) && sizeof($this->Legend)) { $graph->SetLegendPixels($this->width - $right_space+8,40,''); @@ -716,7 +718,7 @@ class DolGraph $plot->mark->setFill(new LightBlue); $plot->mark->border->show(); - // // $group->legend->add($plot, "Unités", 3); + // // $group->legend->add($plot, "Unit�s", 3); $group->add($plot); /* * @@ -812,7 +814,7 @@ class DolGraph $plot->mark->setFill(new LightBlue); $plot->mark->border->show(); - $group->legend->add($plot, "Unités", 3); + $group->legend->add($plot, "Unit�s", 3); $group->add($plot); /* * diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index a53d138e14b..8d38337e4e3 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -59,7 +59,7 @@ if (! $mesg) $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetYLabel($langs->trans("NbOfOrders")); - $px->SetShading(5); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->draw($filename); diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index 9206634e8c9..a2d8ae8ce48 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -205,7 +205,7 @@ if ($_GET["id"] || $_GET["ref"]) $px->SetHeight($HEIGHT); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); - $px->SetShading(5); + $px->SetShading(3); //print 'x '.$key.' '.$graphfiles[$key]['file']; $px->draw($dir."/".$graphfiles[$key]['file']); diff --git a/scripts/banque/graph-solde.php b/scripts/banque/graph-solde.php index 903828d914e..5cb8120d313 100644 --- a/scripts/banque/graph-solde.php +++ b/scripts/banque/graph-solde.php @@ -492,7 +492,7 @@ foreach ($accounts as $account) $px->SetWidth($width); $px->SetHeight($height); $px->SetType('bars'); - $px->SetShading(8); + $px->SetShading(3); $px->draw($file); }