From aa1552dbc02b188b6d4cbc5118dbb1618bfb9ea7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Mar 2020 00:17:16 +0100 Subject: [PATCH] Enhance graphs --- htdocs/compta/bank/graph.php | 40 +++++++++++++---------- htdocs/core/class/dolgraph.class.php | 16 +++++---- htdocs/product/index.php | 4 +-- htdocs/projet/graph_opportunities.inc.php | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 6 files changed, 36 insertions(+), 28 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 2e1f36cbeea..ccf677fa2b8 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -350,10 +350,11 @@ else } $datamin[$i] = $object->min_desired; $dataall[$i] = $object->min_allowed; - if ($xday == '15') + /*if ($xday == '15') // Set only some label for jflot { $labels[$i] = dol_print_date($day, "%b"); - } + }*/ + $labels[$i] = dol_print_date($day, "%Y%m"); $day += 86400; $textdate = strftime("%Y%m%d", $day); $xyear = substr($textdate, 0, 4); @@ -465,10 +466,11 @@ else } $datamin[$i] = $object->min_desired; $dataall[$i] = $object->min_allowed; - if (substr($textdate, 6, 2) == '01' || $i == 0) + /*if (substr($textdate, 6, 2) == '01' || $i == 0) // Set only few label for jflot { - $labels[$i] = substr($textdate, 4, 2); - } + $labels[$i] = substr($textdate, 0, 6); + }*/ + $labels[$i] = substr($textdate, 0, 6); $day += 86400; $textdate = strftime("%Y%m%d", $day); @@ -815,6 +817,8 @@ else } print '

'; +print ''; + // Graphs if ($mode == 'standard') @@ -826,39 +830,39 @@ if ($mode == 'standard') // For month $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Month")." ".img_next('', 'class="valignbottom"').""; - print ''.$link.''; + print '
'.$link.'
'; - print ''; + print '
'; $file = "movement".$account."-".$year.$month.".png"; print $show4; - print ''; + print '
'; - print ''; + print '
'; print $show1; - print ''; + print '
'; // For year $prevyear = $year - 1; $nextyear = $year + 1; $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"').""; - print ''.$link.''; - print ''; + print '
'.$link.'
'; + + print '
'; print $show5; - print ''; + print '
'; - print ''; + print '
'; print $show2; - print ''; + print '
'; } if ($mode == 'showalltime') { - print ''; + print '
'; print $show3; - print ''; + print '
'; } -print ''; // End of page llxFooter(); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 72ce01ed4ef..0616a2e82e6 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1036,7 +1036,9 @@ class DolGraph $dolxaxisvertical=''; if (count($this->data) > 20) $dolxaxisvertical='dol-xaxis-vertical'; // No height for the pie grah - $this->stringtoshow .= '
'."\n"; + $cssfordiv = 'dolgraphchart'; + if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'pie' || $this->type[$firstlot] == 'polar')) $cssfordiv .= ' dolgraphcharpie'; + $this->stringtoshow .= '
'."\n"; $this->stringtoshow .= '