Merge pull request #8387 from OPM/qtcharts-summary-plots

Closes #8228 

Major refactoring of summary plotting. Now possible to create plots both with Qwt and QtChart as plotting tool.
This commit is contained in:
Kristian Bendiksen
2022-01-17 13:14:21 +01:00
committed by GitHub
parent d9bb82de91
commit 258fbddc10
145 changed files with 7245 additions and 2932 deletions

View File

@@ -161,7 +161,7 @@ void RimWellFlowRateCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
m_qwtPlotCurve->setTitle( createCurveAutoName() );
m_plotCurve->setTitle( createCurveAutoName() );
if ( updateParentPlot )
{
@@ -172,7 +172,7 @@ void RimWellFlowRateCurve::onLoadDataAndUpdate( bool updateParentPlot )
updateZoomInParentPlot();
}
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
if ( hasParentPlot() ) m_parentPlot->replot();
}
//--------------------------------------------------------------------------------------------------
@@ -195,9 +195,11 @@ void RimWellFlowRateCurve::updateCurveAppearance()
}
}
if ( isUsingConnectionNumberDepthType() )
QwtPlotCurve* qwtPlotCurve = dynamic_cast<QwtPlotCurve*>( m_plotCurve );
if ( isUsingConnectionNumberDepthType() && qwtPlotCurve )
{
m_qwtPlotCurve->setStyle( QwtPlotCurve::Steps );
// Steps style only for Qwt.
qwtPlotCurve->setStyle( QwtPlotCurve::Steps );
}
if ( m_doFillCurve || isLastCurveInGroup ) // Fill the last curve in group with a transparent color to "tie" the
@@ -222,14 +224,19 @@ void RimWellFlowRateCurve::updateCurveAppearance()
gradient.setColorAt( 0.6, fillColor );
gradient.setColorAt( 0.8, fillColor.darker( 110 ) );
gradient.setColorAt( 1, fillColor );
m_qwtPlotCurve->setBrush( gradient );
m_plotCurve->setBrush( gradient );
QPen curvePen = m_qwtPlotCurve->pen();
curvePen.setColor( lineColor );
m_qwtPlotCurve->setPen( curvePen );
m_qwtPlotCurve->setOrientation( Qt::Horizontal );
m_qwtPlotCurve->setBaseline( 0.0 );
m_qwtPlotCurve->setCurveAttribute( QwtPlotCurve::Inverted, true );
if ( qwtPlotCurve )
{
// Baseline and orientation only available for Qwt.
QPen curvePen = qwtPlotCurve->pen();
curvePen.setColor( lineColor );
qwtPlotCurve->setPen( curvePen );
qwtPlotCurve->setOrientation( Qt::Horizontal );
qwtPlotCurve->setBaseline( 0.0 );
qwtPlotCurve->setCurveAttribute( QwtPlotCurve::Inverted, true );
}
}
}