diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 6ba56ae0129..37d673bcd45 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -147,6 +147,7 @@ $SommeC=0; $SommeD=0; $dataval=array(); $datalabels=array(); +$dataseries=array(); foreach ($AdherentType as $key => $adhtype) { $datalabels[]=$adhtype->getNomUrl(0,dol_size(16)); @@ -165,7 +166,8 @@ $dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']); $dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']); $data=array('series'=>$dataseries,'xlabel'=>$datalabels); -dol_print_graph('stats',300,180,$data,1,'bar'); +dol_print_graph('stats2',300,180,$data,1,'bar'); +$dataseries=array(); */ $dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB))); $dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC))); @@ -174,6 +176,9 @@ $dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=>arr $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie'); print ''; +print ''.$langs->trans("Total").''; +print $SommeA+$SommeB+$SommeC+$SommeD; +print ''; print ''; print ''; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 1fc727c02f4..be6ab9131d1 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1240,6 +1240,7 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='') function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') { global $conf,$langs; + global $theme_datacolor; // To have var kept when function is called several times if (empty($conf->use_javascript_ajax)) return; $jsgraphlib='flot'; $datacolor=array(); @@ -1285,7 +1286,8 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') function plotWithOptions() { jQuery.plot(jQuery("#'.$htmlid.'"), data, { - series: {pie: { + series: { + pie: { show: true, radius: 3/4, label: { @@ -1300,10 +1302,16 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') }, background: { opacity: 0.5, - color: \'#000\' + color: \'#000000\' } } } }, + zoom: { + interactive: true + }, + pan: { + interactive: true + }, '; if (sizeof($datacolor)) { @@ -1317,7 +1325,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') } print '], '; } - print 'legend: {show: '.($showlegend?'true':'false').'} + print 'legend: {show: '.($showlegend?'true':'false').', position: \'ne\' } }); } plotWithOptions(); @@ -1366,7 +1374,14 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie') series: { stack: stack, lines: { show: lines, fill: true, steps: steps }, - bars: { show: bars, barWidth: 0.9, align: \'center\' } + bars: { show: bars, barWidth: 0.9, align: \'center\' }, + shadowSize: 5 + }, + zoom: { + interactive: true + }, + pan: { + interactive: true }, '; if (sizeof($datacolor)) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index fb17552386f..cf395183c8b 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)) $dataseries[]=array('label'=>$langs->trans("Customers"),'values'=>array(round($third['customer']))); if ($conf->fournisseur->enabled) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'values'=>array(round($third['supplier']))); $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,0,'pie'); + dol_print_graph('stats',300,180,$data,1,'pie'); print ''; } else