Commit bf41f58a9255f6faaddff3aa5754ab86660b441f

Authored by Erdogan Furkan
1 parent 4f5b34a4

Integration part for tick time unit

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -517,12 +517,30 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
517 517 if (isset($axisData->{'axis-grid-major-number'}) && $axisData->{'axis-grid-major-number'} != 0)
518 518 $axisNode->getTick()->setMajorGridNumber($axisData->{'axis-grid-major-number'});
519 519 } elseif ($axisData->{'axis-grid-specify-ticks-spacing'}) {
  520 + $timeMultiplier = 1;
  521 + if(isset($axisData->{'axis-tick-time-unit'}) && ($axisData->{'axis-type'} == "time" || $axisData->{'axis-type'} == "epoch" )){
  522 + switch ($axisData->{'axis-tick-time-unit'}) {
  523 + case 'default':
  524 + $timeMultiplier = 1;
  525 + break;
  526 + case 'min':
  527 + $timeMultiplier = 60;
  528 + break;
  529 + case "hour":
  530 + $timeMultiplier = 3600;
  531 + break;
  532 + case "day":
  533 + $timeMultiplier = 86400;
  534 + break;
  535 + }
  536 + }
520 537  
521 538 if (isset($axisData->{'axis-grid-major-space'}) && $axisData->{'axis-grid-major-space'} != 0)
522   - $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'});
  539 + $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'}*$timeMultiplier);
523 540  
524 541 if (isset($axisData->{'axis-grid-minor-space'}) && $axisData->{'axis-grid-minor-space'} != 0)
525   - $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'});
  542 + $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'}*$timeMultiplier);
  543 +
526 544 }
527 545  
528 546  
... ...