diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 180fa2d4954..542251061d3 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -204,7 +204,7 @@ if ($conf->use_javascript_ajax) $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus6, '-'.$badgeStatus0)); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 1eff7f56520..11a9fa8eff6 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -141,7 +141,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index fcd510282df..072abe9625b 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -140,7 +140,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index fde600aff8f..ea180a6b0ee 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -115,10 +115,10 @@ if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); - $dolgraph->setWidth('100%'); + $dolgraph->setHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($totalnb?0:1); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 12939a1f1ee..614743bbc46 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -209,7 +209,7 @@ if (!empty($conf->use_javascript_ajax)) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index a48621bb745..2ebb0f9e2b6 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -30,10 +30,10 @@ * $dolgraph->SetTitle($langs->transnoentities('MyTitle').'
'.$langs->transnoentities('MyTitlePercent').'%'); * $dolgraph->SetMaxValue(50); * $dolgraph->SetData($data); - * $dolgraph->setShowLegend(1); + * $dolgraph->setShowLegend(2); * $dolgraph->setShowPercent(1); * $dolgraph->SetType(array('pie')); - * $dolgraph->setWidth('100%'); + * $dolgraph->setHeight('200'); * $dolgraph->draw('idofgraph'); * print $dolgraph->show($total?0:1); */ @@ -422,7 +422,7 @@ class DolGraph /** * Show legend or not * - * @param int $showlegend 1=Show legend (default), 0=Hide legend + * @param int $showlegend 1=Show legend (default), 0=Hide legend, 2=Show legend on right * @return void */ public function setShowLegend($showlegend) @@ -957,6 +957,8 @@ class DolGraph return; } + $showlegend = $this->showlegend; + $legends = array(); $nblot = 0; if (is_array($this->data) && is_array($this->data[0])) { @@ -1040,6 +1042,7 @@ class DolGraph $this->stringtoshow .= 'circumference: Math.PI,'."\n"; $this->stringtoshow .= 'rotation: -Math.PI,'."\n"; } + if ($showlegend) $this->stringtoshow .= 'legend: { position: \''.($showlegend == 2 ? 'right' : 'top').'\' },'."\n"; $this->stringtoshow .= 'elements: { arc: {'."\n"; // Color of earch arc $this->stringtoshow .= 'backgroundColor: ['; diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 93ce0e910ac..39155dae768 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -137,7 +137,7 @@ if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 2feac415a8d..77cf3bb481e 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -136,7 +136,7 @@ if ($conf->use_javascript_ajax) $dolgraph->SetData($dataseries); $dolgraph->setHeight(350); $dolgraph->combine = empty($conf->global->MAIN_EXPENSEREPORT_COMBINE_GRAPH_STAT) ? 0.05 : $conf->global->MAIN_EXPENSEREPORT_COMBINE_GRAPH_STAT; - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index ff71e3b8786..6bde087fa61 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -140,7 +140,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 45abd70e0be..25c4868fd5e 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -137,10 +137,10 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); - $dolgraph->setWidth('100%'); + $dolgraph->setHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($total ? 0 : 1); diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index 5b730adab6f..b6e69c9c542 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -101,10 +101,10 @@ if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); - $dolgraph->SetHeight(200); + $dolgraph->SetHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($totalnb?0:1); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 163b36ba53f..1c54d002be2 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -174,15 +174,15 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us { $dataseries[] = array($langs->trans("ServicesOnSale"), round($SommeD)); $dataseries[] = array($langs->trans("ServicesOnPurchase"), round($SommeE)); - $dataseries[] = array($langs->trans("ServicesNotOnSell"), round($SommeF)); + $dataseries[] = array(dol_trunc($langs->trans("ServicesNotOnSell"), 24), round($SommeF)); } include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(0); - $dolgraph->SetType(array('piesemicircle')); + $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($total ? 0 : 1); @@ -241,10 +241,10 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); - $dolgraph->setWidth('100%'); + $dolgraph->setHeight('200'); $dolgraph->draw('idstatscategproduct'); print $dolgraph->show($total ? 0 : 1); } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 6d464a08383..e535756ce0c 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -80,7 +80,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); //$dolgraph->setWidth('100%'); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 2ad547700c0..5b89c086c1f 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -112,7 +112,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); @@ -200,10 +200,10 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); - $dolgraph->setWidth('100%'); + $dolgraph->setHeight('200'); $dolgraph->draw('idgraphcateg'); print $dolgraph->show(); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index c5b2739b3d4..57db269cc2e 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -144,7 +144,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->setShowLegend(1); + $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ec2fe9af9a2..d1e79773558 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2348,7 +2348,8 @@ input.vmenusearchselectcombo[type=text] { a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { white-space: nowrap; font-family: ; text-align: ; } -a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */ +a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, +span.vmenu, span.vmenu:link, span.vmenu:visited, span.vmenu:hover, span.vmenu:active { font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */ font.vmenudisabled { font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; } /* bold = 600, 500 is ko with Edge on 1200x960 */ a.vmenu:link, a.vmenu:visited { color: var(--colortextbackvmenu); } diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 5e0360e8ce7..b99dab1f84b 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -239,6 +239,7 @@ if (!empty($dataseries) && count($dataseries) > 1) { $legend[] = $i; $i++; } + $px1->setShowLegend(2); $px1->SetType(array('pie')); $px1->SetLegend($legend); $px1->SetMaxValue($px1->GetCeilMaxValue());