Fix js when no data

This commit is contained in:
Laurent Destailleur 2018-06-11 14:22:01 +02:00
parent 1d7d16649a
commit 5ae1395acd

View File

@ -880,11 +880,18 @@ class DolGraph
$this->stringtoshow.='<script id="'.$tag.'">'."\n"; $this->stringtoshow.='<script id="'.$tag.'">'."\n";
$this->stringtoshow.='$(function () {'."\n"; $this->stringtoshow.='$(function () {'."\n";
$i=$firstlot; $i=$firstlot;
if ($nblot < 0)
{
$this->stringtoshow.='<!-- No series of data -->';
}
else
{
while ($i < $nblot) while ($i < $nblot)
{ {
$this->stringtoshow.=$serie[$i]; $this->stringtoshow.=$serie[$i];
$i++; $i++;
} }
}
$this->stringtoshow.="\n"; $this->stringtoshow.="\n";
// Special case for Graph of type 'pie' // Special case for Graph of type 'pie'