From 590e010fc2838c36cc99aee2af35a183aa16c884 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 11 Dec 2006 14:59:55 +0000 Subject: [PATCH] Ne graph pas si les tables de donnees sont vides --- htdocs/dolgraph.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/dolgraph.class.php b/htdocs/dolgraph.class.php index 5df8939bb9f..8543f77d1b2 100644 --- a/htdocs/dolgraph.class.php +++ b/htdocs/dolgraph.class.php @@ -724,6 +724,8 @@ class DolGraph function BarLineOneYearArtichow($file='', $barvalues, $linevalues, $legends='') { + if (( sizeof($barvalues) * sizeof($linevalues) ) > 0) + { require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/BarPlot.class.php"; require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/LinePlot.class.php"; @@ -802,6 +804,7 @@ class DolGraph */ $graph->add($group); $graph->draw($file); + } } @@ -810,6 +813,9 @@ class DolGraph { require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/BarPlot.class.php"; + if (sizeof($values) > 0) + { + $graph = new Graph(500, 200); $graph->title->set($this->title); $graph->title->setFont(new Tuffy(10)); @@ -845,6 +851,7 @@ class DolGraph $graph->add($plot); $graph->draw($file); + } } }