From 2fae7c89f6183f4e909e7ad2d038cf37c3854b2a Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 29 Jun 2021 15:27:49 +0200 Subject: [PATCH] Improved the Graphic Engine to show correct legends also in RTL. --- config.default.php | 3 +- includes/dashboard.inc | 5 +- reporting/includes/class.graphic.inc | 71 ++++++++++++++++------------ 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/config.default.php b/config.default.php index acd3ddc6..f6911699 100644 --- a/config.default.php +++ b/config.default.php @@ -150,8 +150,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ $graph_skin = 1; /* UTF-8 font for Business Graphics. Copy it to /reporting/fonts/ folder. */ - $UTF8_fontfile = "FreeSans.ttf"; - //$UTF8_fontfile = "zarnormal.ttf"; // for Arabic Dashboard + $UTF8_fontfile = $_SESSION['language']->dir == 'ltr' ? "FreeSans.ttf" : "zarnormal.ttf"; // for Arabic Dashboard /* Display a dropdown select box for choosing Company to login if false. diff --git a/includes/dashboard.inc b/includes/dashboard.inc index 43eb29df..9c2f6d23 100644 --- a/includes/dashboard.inc +++ b/includes/dashboard.inc @@ -11,15 +11,16 @@ ***********************************************************************/ //$colors = array('#008cc9','#4db625','#ef5500','#eef100','#05c6e6', '#5ee66a'); // Current in Use $colors = Chart::$palette; +$align = $_SESSION['language']->dir == 'rtl' ? 'right' : 'left'; $style = "