From 4ee9af96c3af57c1cdec9b6749588247c4fa5218 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 2 Feb 2024 07:20:34 +0100 Subject: [PATCH] Well Allocation: Show legend below pie chart --- .../UserInterface/RiuWellAllocationPlot.cpp | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ApplicationLibCode/UserInterface/RiuWellAllocationPlot.cpp b/ApplicationLibCode/UserInterface/RiuWellAllocationPlot.cpp index 8717cd2210..c2d236604f 100644 --- a/ApplicationLibCode/UserInterface/RiuWellAllocationPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuWellAllocationPlot.cpp @@ -74,21 +74,27 @@ RiuWellAllocationPlot::RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinit mainLayout->addLayout( plotWidgetsLayout ); plotWidgetsLayout->addLayout( leftColumnLayout ); - m_legendWidget = new RiuNightchartsWidget( this ); - new RiuPlotObjectPicker( m_legendWidget, m_plotDefinition->plotLegend() ); - caf::CmdFeatureMenuBuilder menuForSubWidgets; menuForSubWidgets << "RicShowTotalAllocationDataFeature"; - new RiuContextMenuLauncher( m_legendWidget, menuForSubWidgets ); - leftColumnLayout->addWidget( m_legendWidget ); - m_legendWidget->showPie( false ); + { + QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget( this ); + new RiuPlotObjectPicker( totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot() ); + new RiuContextMenuLauncher( totalFlowAllocationWidget, menuForSubWidgets ); - QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget( this ); - new RiuPlotObjectPicker( totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot() ); - new RiuContextMenuLauncher( totalFlowAllocationWidget, menuForSubWidgets ); + leftColumnLayout->addWidget( totalFlowAllocationWidget, Qt::AlignTop ); + } + + { + m_legendWidget = new RiuNightchartsWidget( this ); + new RiuPlotObjectPicker( m_legendWidget, m_plotDefinition->plotLegend() ); + + new RiuContextMenuLauncher( m_legendWidget, menuForSubWidgets ); + + leftColumnLayout->addWidget( m_legendWidget ); + m_legendWidget->showPie( false ); + } - leftColumnLayout->addWidget( totalFlowAllocationWidget, Qt::AlignTop ); leftColumnLayout->addWidget( m_plotDefinition->tofAccumulatedPhaseFractionsPlot()->createViewWidget( this ), Qt::AlignTop ); leftColumnLayout->addStretch();