Commit 475722ad1737e8deadd8a8cc2cf2d110b70a4079
Exists in
master
and in
11 other branches
Merge branch 'FER_11277' into amdadev
Showing
1 changed file
with
23 additions
and
2 deletions
Show diff stats
src/ParamOutputImpl/Plot/PlotOutput.cc
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include "TimePlotNode.hh" |
15 | 15 | #include "ShadesTools.hh" |
16 | 16 | #include "Time/TimePlot.hh" |
17 | +#include "PlPlotUtil.hh" | |
17 | 18 | |
18 | 19 | #include <boost/range/adaptor/reversed.hpp> |
19 | 20 | |
... | ... | @@ -601,6 +602,10 @@ void PlotOutput::computePanelPlotAreaBounds(void) { |
601 | 602 | for (auto plot : _plots) { |
602 | 603 | if (plot->typeName() != TIMEPLOT_NODENAME) |
603 | 604 | continue; |
605 | + | |
606 | + CharSize lCharSizeLegend = PlPlotUtil::getCharacterSizeInPlPage(plot->_panel->_page); | |
607 | + std::tuple<float, float> pageSize = plot->_panel->_page->getSizeInMm(); | |
608 | + | |
604 | 609 | for (Axes::iterator it = plot->_panel->_axes.begin(); it != plot->_panel->_axes.end(); ++it) { |
605 | 610 | boost::shared_ptr<Axis> lAxis = it->second; |
606 | 611 | |
... | ... | @@ -612,12 +617,28 @@ void PlotOutput::computePanelPlotAreaBounds(void) { |
612 | 617 | |
613 | 618 | switch (lAxis->_position) { |
614 | 619 | case PlotCommon::Position::POS_LEFT: |
615 | - if (!isNAN(leftMax)) | |
620 | + if (!isNAN(leftMax)){ | |
616 | 621 | lAxis->setLegendOffset(leftMax); |
622 | + for (auto textLegend : plot->_panel->_textLegendPropertiesList) | |
623 | + { | |
624 | + if (textLegend->getPosition() == TextLegendPosition::POS_LEFT){ | |
625 | + double leftSpace = (textLegend->getTextLinesNb() + PlPlotUtil::LINE_SPACE_TITLE * (textLegend->getTextLinesNb() + 1)) * lCharSizeLegend.second * std::get<1>(pageSize) / std::get<0>(pageSize); | |
626 | + textLegend->setOffset(leftSpace+leftMax); | |
627 | + } | |
628 | + } | |
629 | + } | |
617 | 630 | break; |
618 | 631 | case PlotCommon::Position::POS_RIGHT: |
619 | - if (!isNAN(rightMax)) | |
632 | + if (!isNAN(rightMax)){ | |
620 | 633 | lAxis->setLegendOffset(rightMax); |
634 | + for (auto textLegend : plot->_panel->_textLegendPropertiesList) | |
635 | + { | |
636 | + if (textLegend->getPosition() == TextLegendPosition::POS_RIGHT){ | |
637 | + double rightSpace = (textLegend->getTextLinesNb() + PlPlotUtil::LINE_SPACE_TITLE * (textLegend->getTextLinesNb() + 1)) * lCharSizeLegend.second * std::get<1>(pageSize) / std::get<0>(pageSize); | |
638 | + textLegend->setOffset(rightSpace+rightMax); | |
639 | + } | |
640 | + } | |
641 | + } | |
621 | 642 | break; |
622 | 643 | default: |
623 | 644 | //Nothing to do | ... | ... |