mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5131 : Calculated curves : Always show legend text
This commit is contained in:
parent
b4c5f123fb
commit
03581804e2
@ -926,13 +926,25 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool showLegendInQwt = m_showLegend();
|
||||||
|
|
||||||
RimSummaryPlot* summaryPlot = nullptr;
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
this->firstAncestorOrThisOfType( summaryPlot );
|
this->firstAncestorOrThisOfType( summaryPlot );
|
||||||
|
|
||||||
bool showLegendInQwt = m_showLegend();
|
|
||||||
if ( summaryPlot )
|
if ( summaryPlot )
|
||||||
{
|
{
|
||||||
if ( summaryPlot->ensembleCurveSetCollection()->curveSets().empty() && summaryPlot->curveCount() == 1 )
|
bool anyCalculated = false;
|
||||||
|
for ( const auto c : summaryPlot->summaryCurves() )
|
||||||
|
{
|
||||||
|
if ( c->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||||
|
{
|
||||||
|
// Never hide the legend for calculated curves, as the curve legend is used to
|
||||||
|
// show some essential auto generated data
|
||||||
|
anyCalculated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !anyCalculated && summaryPlot->ensembleCurveSetCollection()->curveSets().empty() &&
|
||||||
|
summaryPlot->curveCount() == 1 )
|
||||||
{
|
{
|
||||||
// Disable display of legend if the summary plot has only one single curve
|
// Disable display of legend if the summary plot has only one single curve
|
||||||
showLegendInQwt = false;
|
showLegendInQwt = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user