#1469 Add checkbox for legend visibility

This commit is contained in:
Magne Sjaastad
2017-05-11 21:44:44 +02:00
parent 764a68c032
commit 4204d49f30
4 changed files with 27 additions and 7 deletions

View File

@@ -65,9 +65,6 @@ RiuFlowCharacteristicsPlot::RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlo
this->setPalette(pal);
m_lorenzPlot = new QwtPlot(this);
QwtLegend* legend = new QwtLegend(this);
m_lorenzPlot->insertLegend(legend, QwtPlot::BottomLegend);
m_flowCapVsStorageCapPlot = new QwtPlot(this);
m_sweepEffPlot = new QwtPlot(this);
@@ -238,6 +235,23 @@ void RiuFlowCharacteristicsPlot::zoomAll()
zoomAllInPlot(m_flowCapVsStorageCapPlot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuFlowCharacteristicsPlot::showLegend(bool show)
{
if (show)
{
// Will be released in plot destructor or when a new legend is set
QwtLegend* legend = new QwtLegend(m_lorenzPlot);
m_lorenzPlot->insertLegend(legend, QwtPlot::BottomLegend);
}
else
{
m_lorenzPlot->insertLegend(nullptr);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------