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); + } } }