Working clicking on Tornado Plots

This commit is contained in:
Gaute Lindkvist
2020-05-05 12:43:44 +02:00
parent 70685b73b4
commit 3240c24f2c
13 changed files with 95 additions and 63 deletions

View File

@@ -39,6 +39,8 @@
#include "cafPdmUiComboBoxEditor.h"
#include "qwt_plot_barchart.h"
#include <limits>
#include <map>
#include <set>
@@ -295,6 +297,26 @@ void RimCorrelationPlot::updatePlotTitle()
m_plotWidget->setPlotTitleFontSize( isMdiWindow() ? 8 : 10 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCorrelationPlot::onPlotItemSelected( QwtPlotItem* plotItem, bool toggle, int sampleIndex )
{
QwtPlotBarChart* barChart = dynamic_cast<QwtPlotBarChart*>( plotItem );
if ( barChart && !curveDefinitions().empty() )
{
auto curveDef = curveDefinitions().front();
auto barTitle = barChart->title();
for ( auto param : ensembleParameters() )
{
if ( barTitle.text() == param.name )
{
emit tornadoItemSelected( param, curveDef );
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------