From 5f17736ff401214fe631767283bde5104f80715c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Sep 2006 22:50:32 +0000 Subject: [PATCH] Meilleur ajustement boite legende --- htdocs/dolgraph.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/dolgraph.class.php b/htdocs/dolgraph.class.php index ca4ae0b8bc2..97fda23ba15 100644 --- a/htdocs/dolgraph.class.php +++ b/htdocs/dolgraph.class.php @@ -199,8 +199,15 @@ class DolGraph if ($phplotversion >= 5) $top_space=25; $left_space=80; // For y labels $right_space=10; // If no legend - if (isset($this->Legend)) $right_space=70; // For legend - + if (isset($this->Legend)) + { + foreach($this->Legend as $key => $val) + { + $maxlen=max($maxlen,$val); + } + $right_space=50+strlen($maxlen)*6; // For legend + } + $this->graph->SetNewPlotAreaPixels($left_space, $top_space, $this->width-$right_space, $this->height-40); if (isset($this->MaxValue)) {