mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8522 Summary Plot: Prune unused axes after move or delete
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user