diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 91e5173c20f..a10051e0e66 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -183,7 +183,7 @@ if ($conf->use_javascript_ajax) $dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD))); $dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=>array(round($SommeA))); $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; print ''.$langs->trans("Total").''; print $SommeA+$SommeB+$SommeC+$SommeD; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index cf5aa0b8b6b..e1a45a76611 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -137,7 +137,7 @@ if ($resql) { print ''; $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; } //if ($totalinprocess != $total) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index be576d20a8a..dfba91c6ab2 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -133,7 +133,7 @@ if ($resql) { print ''; $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; } $bool=false; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 326f5374a5e..65c479c088e 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -190,7 +190,7 @@ if ($conf->use_javascript_ajax) { print ''; $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; } $var=true; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index f4097bdb844..d45eaae36ff 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -134,7 +134,7 @@ if ($resql) { print ''; $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; } //if ($totalinprocess != $total) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 5e3f0f415d8..64eb2c033f0 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1236,9 +1236,10 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='') * @param height Height in pixel * @param data Data array * @param showlegend Show legend - * @param type Type of graph (pie, bar, line) + * @param type Type of graph ('pie', 'barline') + * @param showpercent Show percent (with type='pie' only) */ -function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') +function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',$showpercent=0) { global $conf,$langs; global $theme_datacolor; // To have var kept when function is called several times @@ -1301,7 +1302,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') var percent=Math.round(series.percent); var number=series.data[0][1]; return \'
\'+'.($showlegend?'number':'label+\'
\'+number'); - if (! empty($showpercent)) print '+\'
\'+percent'; + if (! empty($showpercent)) print '+\'
\'+percent+\'%\''; print '+\'
\'; }, background: { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 5cb4dfa7429..29dca4789fb 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -108,7 +108,7 @@ if ($conf->use_javascript_ajax && ((round($third['prospect'])?1:0)+(round($third if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'values'=>array(round($third['customer']))); if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'values'=>array(round($third['supplier']))); $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie',0); print ''; } else