Commit d62f9945973eeb461427e1a17cd1f022b7b3366f

Authored by Benjamin Renard
1 parent 82356278

Improve instant cut plot (#8669)

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -544,10 +544,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
544 544 if (isset($axisData->{'axis-legend-text'}) && $axisData->{'axis-legend-text'} != '')
545 545 {
546 546 $axisNode->getLegend()->setText($axisData->{'axis-legend-text'});
547   - $axisNode->getLegend()->setColor($this->hexColor2KernelColor($axisData->{'axis-legend-color'}));
548   - $this->unmarshallLabel($axisData, "axis-legend", $axisNode->getLegend());
549 547 }
550   -
  548 + $axisNode->getLegend()->setColor($this->hexColor2KernelColor($axisData->{'axis-legend-color'}));
  549 + $this->unmarshallLabel($axisData, "axis-legend", $axisNode->getLegend());
  550 +
551 551 //Show legend
552 552 if (isset($axisData->{'axis-legend-activated'}))
553 553 $axisNode->setShowLegend($axisData->{'axis-legend-activated'} ? "true" : "false");
... ... @@ -1224,35 +1224,35 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1224 1224 if ($inputData->{$keyPrefix.'-text'} != '')
1225 1225 {
1226 1226 $titleNode->setText($inputData->{$keyPrefix.'-text'});
  1227 + }
1227 1228  
1228   - switch ($inputData->{$keyPrefix.'-position'})
1229   - {
1230   - case 'top' :
1231   - $titleNode->setPosition(RequestOutputPlotTitlePosition::TOP);
1232   - break;
1233   - case 'bottom' :
1234   - $titleNode->setPosition(RequestOutputPlotTitlePosition::BOTTOM);
1235   - break;
1236   - }
1237   -
1238   - switch ($inputData->{$keyPrefix.'-alignment'})
1239   - {
1240   - case 'center' :
1241   - $titleNode->setAlign(RequestOutputPlotTitleAlign::CENTER);
1242   - break;
1243   - case 'left' :
1244   - $titleNode->setAlign(RequestOutputPlotTitleAlign::LEFT);
1245   - break;
1246   - case 'right' :
1247   - $titleNode->setAlign(RequestOutputPlotTitleAlign::RIGHT);
1248   - break;
1249   - }
1250   -
1251   - if ($inputData->{$keyPrefix.'-color'} != '')
1252   - $titleNode->setColor($this->hexColor2KernelColor($inputData->{$keyPrefix.'-color'}));
  1229 + switch ($inputData->{$keyPrefix.'-position'})
  1230 + {
  1231 + case 'top' :
  1232 + $titleNode->setPosition(RequestOutputPlotTitlePosition::TOP);
  1233 + break;
  1234 + case 'bottom' :
  1235 + $titleNode->setPosition(RequestOutputPlotTitlePosition::BOTTOM);
  1236 + break;
  1237 + }
1253 1238  
1254   - $this->unmarshallLabel($inputData, $keyPrefix, $titleNode);
  1239 + switch ($inputData->{$keyPrefix.'-alignment'})
  1240 + {
  1241 + case 'center' :
  1242 + $titleNode->setAlign(RequestOutputPlotTitleAlign::CENTER);
  1243 + break;
  1244 + case 'left' :
  1245 + $titleNode->setAlign(RequestOutputPlotTitleAlign::LEFT);
  1246 + break;
  1247 + case 'right' :
  1248 + $titleNode->setAlign(RequestOutputPlotTitleAlign::RIGHT);
  1249 + break;
1255 1250 }
  1251 +
  1252 + if ($inputData->{$keyPrefix.'-color'} != '')
  1253 + $titleNode->setColor($this->hexColor2KernelColor($inputData->{$keyPrefix.'-color'}));
  1254 +
  1255 + $this->unmarshallLabel($inputData, $keyPrefix, $titleNode);
1256 1256 }
1257 1257  
1258 1258 protected function unmarshallLabel($inputData, $keyPrefix, $labelNode)
... ... @@ -1857,6 +1857,9 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1857 1857 "id" => "1",
1858 1858 "panel-plot-type" => "instantPlot",
1859 1859 "panel-instant-time" => $input->time,
  1860 + "panel-title-font-activated" => TRUE,
  1861 + "panel-title-font-size" => 12,
  1862 + "panel-title-font-bold" => TRUE,
1860 1863 "axes" => array(),
1861 1864 "params" => array(),
1862 1865  
... ... @@ -1866,14 +1869,26 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1866 1869 "id" => "xaxis_id",
1867 1870 "axis-type" => "x",
1868 1871 "axis-scale" => $crtYAxis->{"axis-scale"},
1869   - "axis-thickness" => 1
  1872 + "axis-thickness" => 1,
  1873 + "axis-legend-font-activated" => TRUE,
  1874 + "axis-legend-font-size" => 12,
  1875 + "axis-legend-font-bold" => TRUE,
  1876 + "axis-range-min" => $crtYAxis->{"axis-range-min"},
  1877 + "axis-range-max" => $crtYAxis->{"axis-range-max"},
  1878 + "axis-reverse" => $crtYAxis->{"axis-reverse"},
1870 1879 );
1871 1880  
1872 1881 $instantYAxis = (Object)array(
1873 1882 "id" => "y-left",
1874 1883 "axis-type" => "y-left",
1875 1884 "axis-scale" => $crtColorAxis->{"axis-scale"},
1876   - "axis-thickness" => 1
  1885 + "axis-thickness" => 1,
  1886 + "axis-legend-font-activated" => TRUE,
  1887 + "axis-legend-font-size" => 12,
  1888 + "axis-legend-font-bold" => TRUE,
  1889 + "axis-range-min" => $crtColorAxis->{"axis-range-min"},
  1890 + "axis-range-max" => $crtColorAxis->{"axis-range-max"},
  1891 + "axis-reverse" => $crtColorAxis->{"axis-reverse"},
1877 1892 );
1878 1893 $instantPanel->{"axes"}[] = $instantXAxis;
1879 1894 $instantPanel->{"axes"}[] = $instantYAxis;
... ... @@ -1887,8 +1902,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1887 1902 "iserie-tableonx" => true,
1888 1903 "iserie-lines-activated" => true,
1889 1904 "iserie-lines-style" => "plain",
1890   - "iserie-lines-width" => 1,
1891   - "iserie-lines-color" => "auto"
  1905 + "iserie-lines-width" => 3,
  1906 + "iserie-lines-color" => "#0000ff"
1892 1907 ),
1893 1908 "dim1-index" => $crtParam->{'dim1-index'},
1894 1909 "dim1-sum-type" => $crtParam->{'dim1-sum-type'},
... ...