From e06e53a2b2bc576a54bfb9fff208dae5a02f496d Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 6 Aug 2025 17:49:07 +0200 Subject: [PATCH] Fix color on graph and label in legend --- htdocs/compta/bank/graph.php | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index b2a93aa2d4f..215be5e9eec 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2024-2025 MDW +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -136,7 +136,7 @@ if ($result < 0) { dol_syslog($log); - // Tableau 1 + // Graph balance of the month if ($mode == 'standard') { // Loading table $amounts @@ -259,6 +259,9 @@ if ($result < 0) { } $px1 = new DolGraph(); + + $px1->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220)); + $px1->SetData($graph_datas); $arraylegends = array($langs->transnoentities("Balance")); if ($object->min_desired) { @@ -397,6 +400,9 @@ if ($result < 0) { } } $px2 = new DolGraph(); + + $px2->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220)); + $px2->SetData($graph_datas); $arraylegends = array($langs->transnoentities("Balance")); if ($object->min_desired) { @@ -515,6 +521,9 @@ if ($result < 0) { } $px3 = new DolGraph(); + + $px3->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220)); + $px3->SetData($graph_datas); $arraylegends = array($langs->transnoentities("Balance")); if ($object->min_desired) { @@ -546,7 +555,7 @@ if ($result < 0) { $amounts = null; } - // Tableau 4a - Credit/Debit + // Graph input/output - Credit/Debit for the month if ($mode == 'standard') { // Chargement du tableau $credits, $debits @@ -645,7 +654,7 @@ if ($result < 0) { } $px4 = new DolGraph(); $px4->SetData($graph_datas); - $px4->SetLegend(array($langs->transnoentities("Credit"), $langs->transnoentities("Debit"))); + $px4->SetLegend(array($langs->transnoentities("Credit").' ('.$langs->trans("Input").')', $langs->transnoentities("Debit").' ('.$langs->trans("Output").')')); $px4->SetLegendWidthMin(180); $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue()); $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue()); @@ -746,7 +755,7 @@ if ($result < 0) { } $px5 = new DolGraph(); $px5->SetData($graph_datas); - $px5->SetLegend(array($langs->transnoentities("Credit"), $langs->transnoentities("Debit"))); + $px5->SetLegend(array($langs->transnoentities("Credit").' ('.$langs->trans("Input").')', $langs->transnoentities("Debit").' ('.$langs->trans("Output").')')); $px5->SetLegendWidthMin(180); $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue()); $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue()); @@ -810,7 +819,7 @@ print dol_get_fiche_end(); $head = bank_report_prepare_head($object); print dol_get_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0); -print ''; +print '
'; // Navigation links print '
'.$morehtml.'     '; @@ -860,6 +869,8 @@ if ($mode == 'standard') { print $show1; print ''; + print '

'; + // For year $prevyear = (int) $year - 1; $nextyear = (int) $year + 1;