mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
#7752 Statistics Plot: Add titles for x and y axis
This commit is contained in:
parent
d1ecac012d
commit
84bf5d5454
@ -164,3 +164,13 @@ QString RimEnsembleFractureStatisticsPlot::createAutoName() const
|
||||
|
||||
return nameTags.join( ", " );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEnsembleFractureStatisticsPlot::createXAxisTitle() const
|
||||
{
|
||||
if ( m_ensembleFractureStatistics() == nullptr ) return "";
|
||||
|
||||
return caf::AppEnum<RigEnsembleFractureStatisticsCalculator::PropertyType>::uiText( m_property() );
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ protected:
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
QString createAutoName() const override;
|
||||
QString createXAxisTitle() const override;
|
||||
|
||||
void setDefaults();
|
||||
bool hasStatisticsData() const override;
|
||||
|
@ -314,3 +314,22 @@ QString RimGridStatisticsPlot::timeStepString() const
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridStatisticsPlot::createXAxisTitle() const
|
||||
{
|
||||
if ( m_case() == nullptr ) return "";
|
||||
|
||||
QStringList nameTags;
|
||||
nameTags += m_property()->resultVariable();
|
||||
|
||||
QString timeStepStr = timeStepString();
|
||||
if ( !timeStepStr.isEmpty() )
|
||||
{
|
||||
nameTags += timeStepStr;
|
||||
}
|
||||
|
||||
return nameTags.join( ", " );
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ protected:
|
||||
QString createAutoName() const override;
|
||||
QString timeStepString() const;
|
||||
|
||||
QString createXAxisTitle() const override;
|
||||
|
||||
void setDefaults();
|
||||
bool hasStatisticsData() const override;
|
||||
RigHistogramData createStatisticsData() const override;
|
||||
|
@ -311,11 +311,13 @@ void RimStatisticsPlot::updatePlots()
|
||||
QValueAxis* axisX = new QValueAxis();
|
||||
axisX->setRange( histogramData.min - xAxisExtension, histogramData.max + xAxisExtension );
|
||||
axisX->setLabelFormat( RiaNumberFormat::sprintfFormat( m_tickNumberFormat(), m_precision ) );
|
||||
axisX->setTitleText( createXAxisTitle() );
|
||||
chart->addAxis( axisX, Qt::AlignBottom );
|
||||
|
||||
QValueAxis* axisY = new QValueAxis();
|
||||
axisY->setRange( minValue, maxValue );
|
||||
axisY->setLabelFormat( RiaNumberFormat::sprintfFormat( m_tickNumberFormat(), m_precision ) );
|
||||
axisY->setTitleText( createYAxisTitle() );
|
||||
chart->addAxis( axisY, Qt::AlignLeft );
|
||||
|
||||
if ( !std::isinf( histogramData.p10 ) )
|
||||
@ -382,3 +384,11 @@ void RimStatisticsPlot::performAutoNameUpdate()
|
||||
m_plotWindowTitle = name;
|
||||
setUiName( name );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimStatisticsPlot::createYAxisTitle() const
|
||||
{
|
||||
return caf::AppEnum<RimStatisticsPlot::HistogramFrequencyType>::uiText( m_histogramFrequencyType() );
|
||||
}
|
||||
|
@ -79,6 +79,9 @@ protected:
|
||||
virtual RigHistogramData createStatisticsData() const = 0;
|
||||
virtual QString createAutoName() const = 0;
|
||||
|
||||
virtual QString createXAxisTitle() const = 0;
|
||||
virtual QString createYAxisTitle() const;
|
||||
|
||||
void performAutoNameUpdate();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user