mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-24 15:26:48 -06:00
#2816 Summary Curves : Hide legend in Qwt if only one curve is present
This commit is contained in:
parent
6463a67107
commit
c831553cc2
@ -17,9 +17,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
|
||||
@ -578,19 +580,15 @@ void RimPlotCurve::updateLegendEntryVisibilityAndPlotLegend()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
||||
{
|
||||
if (m_showLegend())
|
||||
bool showLegendInQwt = m_showLegend();
|
||||
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(summaryPlot);
|
||||
if (summaryPlot && summaryPlot->curveCount() == 1)
|
||||
{
|
||||
if (m_curveName().isEmpty())
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
|
||||
// Disable display of legend if the summary plot has only one single curve
|
||||
showLegendInQwt = false;
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user