mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8676 QtChart : Create curve legend widget for multiplot
This commit is contained in:
@@ -1789,6 +1789,34 @@ RimPlotAxisProperties* RimSummaryPlot::addNewAxisProperties( RiuPlotAxis plotAxi
|
||||
return axisProperties;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlotCurve*> RimSummaryPlot::visibleCurvesForLegend()
|
||||
{
|
||||
std::vector<RimPlotCurve*> curves;
|
||||
|
||||
for ( auto c : summaryCurves() )
|
||||
{
|
||||
if ( !c->isCurveVisible() ) continue;
|
||||
if ( !c->showInLegend() ) continue;
|
||||
curves.push_back( c );
|
||||
}
|
||||
|
||||
for ( auto curveSet : curveSets() )
|
||||
{
|
||||
if ( !curveSet->isCurvesVisible() ) continue;
|
||||
if ( curveSet->colorMode() == RimEnsembleCurveSetColorManager::ColorMode::SINGLE_COLOR )
|
||||
{
|
||||
auto curveSetCurves = curveSet->curves();
|
||||
|
||||
if ( !curveSetCurves.empty() ) curves.push_back( curveSetCurves.front() );
|
||||
}
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -199,6 +199,8 @@ public:
|
||||
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name );
|
||||
|
||||
std::vector<RimPlotCurve*> visibleCurvesForLegend() override;
|
||||
|
||||
public:
|
||||
// RimViewWindow overrides
|
||||
void deleteViewWidget() override;
|
||||
|
||||
Reference in New Issue
Block a user