Improve legend display of ensemble curves

Remove symbol and increase curve thickness
This commit is contained in:
Magne Sjaastad 2023-11-27 11:13:37 +01:00
parent 163b742ad0
commit ec53c7704d

View File

@ -2108,6 +2108,12 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector<RimSummaryCase
if ( !m_plotCurveForLegendText )
{
m_plotCurveForLegendText.reset( plot->plotWidget()->createPlotCurve( nullptr, "" ) );
int curveThickness = 3;
m_plotCurveForLegendText->setAppearance( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID,
RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_POINT_TO_POINT,
curveThickness,
RiaColorTools::toQColor( m_mainEnsembleColor() ) );
}
m_plotCurveForLegendText->attachToPlot( plot->plotWidget() );
updateEnsembleLegendItem();
@ -2449,27 +2455,25 @@ void RimEnsembleCurveSet::updateEnsembleLegendItem()
m_plotCurveForLegendText->setTitle( name() );
RiuPlotCurveSymbol* symbol = m_plotCurveForLegendText->createSymbol( RiuPlotCurveSymbol::SYMBOL_NONE );
if ( RimEnsembleCurveSetColorManager::hasSameColorForAllRealizationCurves( m_colorMode() ) )
{
RiuPlotCurveSymbol* symbol = m_plotCurveForLegendText->createSymbol( RiuPlotCurveSymbol::SYMBOL_CROSS );
QColor curveColor = mainEnsembleColor();
QPen curvePen( curveColor );
curvePen.setWidth( 2 );
if ( RimEnsembleCurveSetColorManager::hasSameColorForAllRealizationCurves( m_colorMode() ) )
{
QColor curveColor = mainEnsembleColor();
QPen curvePen( curveColor );
curvePen.setWidth( 2 );
symbol->setPen( curvePen );
symbol->setSize( 6, 6 );
}
else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM )
{
QPixmap p = QPixmap( ":/Legend.png" );
symbol->setPixmap( p );
symbol->setSize( 8, 8 );
}
m_plotCurveForLegendText->setSymbol( symbol );
symbol->setPen( curvePen );
symbol->setSize( 6, 6 );
}
else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM )
{
QPixmap p = QPixmap( ":/Legend.png" );
symbol->setPixmap( p );
symbol->setSize( 8, 8 );
}
m_plotCurveForLegendText->setSymbol( symbol );
bool showLegendItem = isCurvesVisible();
m_plotCurveForLegendText->setVisibleInLegend( showLegendItem );