From bf41f58a9255f6faaddff3aa5754ab86660b441f Mon Sep 17 00:00:00 2001 From: Furkan Date: Tue, 2 May 2023 14:46:07 +0200 Subject: [PATCH] Integration part for tick time unit --- src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php index ce8233d..b724b90 100644 --- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php +++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php @@ -517,12 +517,30 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass if (isset($axisData->{'axis-grid-major-number'}) && $axisData->{'axis-grid-major-number'} != 0) $axisNode->getTick()->setMajorGridNumber($axisData->{'axis-grid-major-number'}); } elseif ($axisData->{'axis-grid-specify-ticks-spacing'}) { + $timeMultiplier = 1; + if(isset($axisData->{'axis-tick-time-unit'}) && ($axisData->{'axis-type'} == "time" || $axisData->{'axis-type'} == "epoch" )){ + switch ($axisData->{'axis-tick-time-unit'}) { + case 'default': + $timeMultiplier = 1; + break; + case 'min': + $timeMultiplier = 60; + break; + case "hour": + $timeMultiplier = 3600; + break; + case "day": + $timeMultiplier = 86400; + break; + } + } if (isset($axisData->{'axis-grid-major-space'}) && $axisData->{'axis-grid-major-space'} != 0) - $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'}); + $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'}*$timeMultiplier); if (isset($axisData->{'axis-grid-minor-space'}) && $axisData->{'axis-grid-minor-space'} != 0) - $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'}); + $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'}*$timeMultiplier); + } -- libgit2 0.21.2