#2760 Ensemble Curves: Show one curve legend

This commit is contained in:
Magne Sjaastad committed 2018-04-30 08:01:17 +02:00
1 parent 1a0f242c0b
commit 0da7686cdb
7 files changed
+52 -28

No files matched your search

@@ -19,6 +19,7 @@
#include "RimPlotCurve.h"
#include "RimEnsembleCurveSet.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveCollection.h"
#include "RimSummaryCurveFilter.h"
#include "RimSummaryPlot.h"
@@ -590,5 +591,17 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
showLegendInQwt = false;
}
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
this->firstAncestorOrThisOfType(ensembleCurveSet);
if (ensembleCurveSet)
{
auto firstCurve = ensembleCurveSet->firstCurve();
if (firstCurve != this)
{
// Hide legend display for curves other than the first
showLegendInQwt = false;
}
}
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
}