From 0cea6b06f78d63857c2a99784a3fec58f4feede7 Mon Sep 17 00:00:00 2001
From: Menouar AZIB <menouar.azib@akka.eu>
Date: Mon, 13 Mar 2023 16:58:49 +0100
Subject: [PATCH] Set preview font style to plt function axis. And expand layout

---
 src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
index 1c17ad9..e670d9f 100644
--- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
+++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -1966,6 +1966,15 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 		return $instantPlotInput;
 	}
 
+	/**
+	 * Set preview font style to given axis 
+	 */
+	private function setPlotPreviewFont($axis){
+		$axis->{"axis-legend-font-activated"} = TRUE;
+		$axis->{"axis-legend-font-size"} = 12;
+		$axis->{"axis-legend-font-bold"} = TRUE;
+	}
+
 	private function unmarshallPlotFunction($input, $plotInput)
 	{
 		date_default_timezone_set('UTC');
@@ -1980,6 +1989,14 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 		$plotInput->{"interactive-preview"} = true;
 		$plotInput->{"file-format"} = "PNG";
 		$plotInput->{"file-output"} = "INTERACTIVE";
+		$plotInput->{"page-layout-type"} = "vertical";
+		$plotInput->{"page-layout-object"} =  (object)array(
+			"layout-expand" => true,
+			"layout-panel-height" => 0.5,
+			"layout-panel-spacing" => 0.05
+		);
+
+		
 
 		foreach ($plotInput->{'panels'} as $panel) {
 			if ($input->{'panelId'} == $panel->{'id'}) {
@@ -1991,6 +2008,9 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 				$scale_abscisse = $input->scale_abscisse;
 				$scale_ordonnee = $input->scale_ordonnee;
 				$panel->{'panel-plot-type'} = RequestOutPutPlotElementPlotFunctionNodeClass::REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME;
+				$panel->{"panel-title-font-activated"} = TRUE;
+				$panel->{"panel-title-font-size"} = 12;
+				$panel->{"panel-title-font-bold"} = TRUE;
 
 				/**
 				 * @var object $crtParam
@@ -2096,6 +2116,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 					}
 				}
 
+				$this->setPlotPreviewFont($plotFctXAxisDigital);
+				$this->setPlotPreviewFont($plotFctYAxis);
+				$this->setPlotPreviewFont($plotFctXAxisTime);
+
 				/**
 				 * In this block, I will update the axis scale depending on the user choice hosted in thess variables $scale_abscisse and scale_ordonnee. 
 				 * If 'Inherites' is selected then the scale of axis of the current time plot are used.
@@ -2119,4 +2143,5 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 
 		return $plotInput;
 	}
+
 }
--
libgit2 0.21.2