#8522 Summary Plot: Prune unused axes after move or delete

This commit is contained in:
Kristian Bendiksen
2022-02-21 11:32:26 +01:00
parent 1a1acfa006
commit 10cb2d7d0b
9 changed files with 62 additions and 11 deletions

View File

@@ -845,7 +845,7 @@ void RimSummaryPlot::updateZoomForAxis( RiuPlotAxis plotAxis )
}
double min, max;
RimPlotAxisLogRangeCalculator calc( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, plotCurves );
RimPlotAxisLogRangeCalculator calc( plotAxis.axis(), plotCurves );
calc.computeAxisRange( &min, &max );
if ( yAxisProps->isAxisInverted() )
@@ -2008,7 +2008,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent
for ( auto axisProperties : m_axisProperties )
{
plotWidget()->ensureAxis( axisProperties->plotAxisType() );
plotWidget()->ensureAxisIsCreated( axisProperties->plotAxisType() );
}
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
@@ -2482,6 +2482,13 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childAr
if ( plotWidget() )
{
std::set<RiuPlotAxis> usedPlotAxis;
for ( auto axisProperties : m_axisProperties )
{
usedPlotAxis.insert( axisProperties->plotAxisType() );
}
plotWidget()->pruneAxes( usedPlotAxis );
updateAxes();
plotWidget()->scheduleReplot();
}