mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve plot titles and layout adjustments
This commit is contained in:
@@ -703,6 +703,15 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
|
||||
m_timeStepToFlowResultMap = timeStepToFlowResultMap;
|
||||
|
||||
if ( m_case() )
|
||||
{
|
||||
m_flowCharPlotWidget->setCaseName( m_case()->caseUserDescription() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_flowCharPlotWidget->setCaseName( "" );
|
||||
}
|
||||
|
||||
m_flowCharPlotWidget->setLorenzCurve( timeStepStrings, timeStepDates, lorenzVals );
|
||||
|
||||
for ( int timeStepIdx : m_currentlyPlottedTimeSteps )
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include "RigAccWellFlowCalculator.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
@@ -55,6 +56,8 @@
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
|
||||
#include "qwt_scale_draw.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellAllocationOverTimePlot, "RimWellAllocationOverTimePlot" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -281,6 +284,16 @@ RiuPlotWidget* RimWellAllocationOverTimePlot::doCreatePlotViewWidget( QWidget* m
|
||||
// Workaround: Enable axis title for bottom axis to activate correct font size for date axis
|
||||
m_plotWidget->setAxisTitleEnabled( RiuPlotAxis::defaultBottom(), true );
|
||||
m_plotWidget->setAxisTitleEnabled( RiuPlotAxis::defaultLeft(), true );
|
||||
|
||||
if ( auto qwtPlot = m_plotWidget->qwtPlot() )
|
||||
{
|
||||
auto scaleDraw = qwtPlot->axisScaleDraw( QwtAxis::XBottom );
|
||||
if ( scaleDraw )
|
||||
{
|
||||
scaleDraw->setLabelRotation( 30.0 );
|
||||
}
|
||||
}
|
||||
|
||||
m_plotWidget->insertLegend( RiuPlotWidget::Legend::RIGHT );
|
||||
|
||||
m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultBottom(), "[Date]" );
|
||||
@@ -393,7 +406,10 @@ void RimWellAllocationOverTimePlot::updateFromWell()
|
||||
QString newDescription = descriptionText + ", " + valueTypeText;
|
||||
|
||||
setDescription( newDescription );
|
||||
m_plotWidget->setWindowTitle( newDescription );
|
||||
|
||||
const auto windowTitle = RiaStdStringTools::removeHtmlTags( newDescription.toStdString() );
|
||||
m_plotWidget->setWindowTitle( QString::fromStdString( windowTitle ) );
|
||||
|
||||
m_plotWidget->setPlotTitle( descriptionText + "<br>" + valueTypeText + "</br>" );
|
||||
m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultLeft(), valueTypeText );
|
||||
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaWellFlowDefines.h"
|
||||
|
||||
#include "RigAccWellFlowCalculator.h"
|
||||
@@ -677,6 +678,9 @@ void RimWellConnectivityTable::onLoadDataAndUpdate()
|
||||
m_matrixPlotWidget->setAxisTitleFontSize( axisTitleFontSize() );
|
||||
m_matrixPlotWidget->setAxisLabelFontSize( axisLabelFontSize() );
|
||||
|
||||
const auto windowTitle = RiaStdStringTools::removeHtmlTags( createTableTitle().toStdString() );
|
||||
m_matrixPlotWidget->setWindowTitle( QString::fromStdString( windowTitle ) );
|
||||
|
||||
m_matrixPlotWidget->createPlot();
|
||||
}
|
||||
|
||||
|
@@ -350,7 +350,6 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
|
||||
const QString timeStepName = m_case ? m_case->timeStepName( m_timeStepIndex ) : "N/A";
|
||||
|
||||
const QString plotTitleStr = QString( "%1 Distribution: %2, %3" ).arg( phaseString ).arg( m_wellName ).arg( timeStepName );
|
||||
m_plotWidget->setPlotTitleRenderingFlags( Qt::AlignHCenter | Qt::TextWordWrap );
|
||||
m_plotWidget->setPlotTitle( plotTitleStr );
|
||||
|
||||
m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultBottom(), "TOF [years]" );
|
||||
|
@@ -18,6 +18,9 @@
|
||||
|
||||
#include "RimWellDistributionPlotCollection.h"
|
||||
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimEclipseCaseTools.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
@@ -28,8 +31,6 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigTofWellDistributionCalculator.h"
|
||||
|
||||
#include "RiaColorTools.h"
|
||||
|
||||
#include "RiuMultiPlotPage.h"
|
||||
#include "RiuPlotWidget.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
@@ -200,6 +201,12 @@ QWidget* RimWellDistributionPlotCollection::createViewWidget( QWidget* mainWindo
|
||||
{
|
||||
m_viewer = new RiuMultiPlotPage( this, mainWindowParent );
|
||||
m_viewer->setPlotTitle( m_plotWindowTitle );
|
||||
|
||||
auto pointSize =
|
||||
caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize(), caf::FontTools::RelativeSize::XLarge );
|
||||
|
||||
m_viewer->setTitleFontSizes( pointSize, pointSize );
|
||||
|
||||
recreatePlotWidgets();
|
||||
|
||||
return m_viewer;
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTimeHistoryCurveResampler.h"
|
||||
|
||||
@@ -86,6 +87,7 @@ RimSummaryTable::RimSummaryTable()
|
||||
|
||||
// Table settings
|
||||
CAF_PDM_InitField( &m_showValueLabels, "ShowValueLabels", false, "Show Value Labels" );
|
||||
CAF_PDM_InitField( &m_maxTimeLabelCount, "MaxTimeLabelCount", 20, "Maximum Time Label Count" );
|
||||
|
||||
// Font control
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisTitleFontSize, "AxisTitleFontSize", "Axis Title Font Size" );
|
||||
@@ -283,6 +285,10 @@ void RimSummaryTable::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
}
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
else if ( changedField == &m_maxTimeLabelCount )
|
||||
{
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -323,6 +329,7 @@ void RimSummaryTable::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
||||
fontGroup->add( &m_axisTitleFontSize );
|
||||
fontGroup->add( &m_axisLabelFontSize );
|
||||
fontGroup->add( &m_valueLabelFontSize );
|
||||
fontGroup->add( &m_maxTimeLabelCount );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -464,6 +471,10 @@ void RimSummaryTable::onLoadDataAndUpdate()
|
||||
m_matrixPlotWidget->setLegendFontSize( legendFontSize() );
|
||||
m_matrixPlotWidget->setAxisTitleFontSize( axisTitleFontSize() );
|
||||
m_matrixPlotWidget->setAxisLabelFontSize( axisLabelFontSize() );
|
||||
m_matrixPlotWidget->setMaxColumnLabelCount( m_maxTimeLabelCount() );
|
||||
|
||||
const auto windowTitle = RiaStdStringTools::removeHtmlTags( title.toStdString() );
|
||||
m_matrixPlotWidget->setWindowTitle( QString::fromStdString( windowTitle ) );
|
||||
|
||||
m_matrixPlotWidget->createPlot();
|
||||
}
|
||||
|
@@ -127,6 +127,7 @@ private:
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisLabelFontSize;
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_valueLabelFontSize;
|
||||
caf::PdmField<bool> m_showValueLabels;
|
||||
caf::PdmField<int> m_maxTimeLabelCount;
|
||||
|
||||
caf::PdmField<RimRegularLegendConfig::MappingEnum> m_mappingType;
|
||||
caf::PdmField<caf::AppEnum<RangeType>> m_rangeType;
|
||||
|
Reference in New Issue
Block a user