mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Correlation Matrix Plot
This commit is contained in:
@@ -507,10 +507,10 @@ void RiuGroupedBarChartBuilder::addBarChartToPlot( QwtPlot* plot, Qt::Orientatio
|
||||
barPoints = &( legendToBarPointsPair->second );
|
||||
}
|
||||
|
||||
barPoints->push_back( {currentBarPosition, barDef.m_value} );
|
||||
barPoints->push_back( { currentBarPosition, barDef.m_value } );
|
||||
if ( !barDef.m_barText.isEmpty() )
|
||||
{
|
||||
positionedBarLabels[currentBarPosition] = {QwtScaleDiv::MinorTick, barDef.m_barText};
|
||||
positionedBarLabels[currentBarPosition] = { QwtScaleDiv::MinorTick, barDef.m_barText };
|
||||
}
|
||||
|
||||
// Increment the bar position for the next bar
|
||||
|
||||
@@ -622,7 +622,9 @@ void RiuMultiPlotPage::reinsertPlotWidgets()
|
||||
|
||||
subTitles[visibleIndex]->setVisible( m_showSubTitles );
|
||||
|
||||
plotWidgets[visibleIndex]->setAxisLabelsAndTicksEnabled( QwtPlot::yLeft, showYAxis( row, column ) );
|
||||
plotWidgets[visibleIndex]->setAxisLabelsAndTicksEnabled( QwtPlot::yLeft,
|
||||
showYAxis( row, column ),
|
||||
showYAxis( row, column ) );
|
||||
plotWidgets[visibleIndex]->setAxisTitleEnabled( QwtPlot::yLeft, showYAxis( row, column ) );
|
||||
|
||||
plotWidgets[visibleIndex]->show();
|
||||
|
||||
@@ -33,3 +33,20 @@ QwtScaleDiv RiuQwtLinearScaleEngine::divideScaleWithExplicitIntervals( double x1
|
||||
|
||||
return QwtScaleDiv( x1, x2, minorTicks, minorTicks, majorTicks );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QwtScaleDiv RiuQwtLinearScaleEngine::divideScaleWithExplicitIntervalsAndRange( double tickStart,
|
||||
double tickEnd,
|
||||
double majorStepInterval,
|
||||
double minorStepInterval,
|
||||
double rangeStart,
|
||||
double rangeEnd )
|
||||
{
|
||||
QwtInterval tickInterval( tickStart, tickEnd );
|
||||
QList<double> majorTicks = this->buildMajorTicks( tickInterval, majorStepInterval );
|
||||
QList<double> minorTicks = this->buildMajorTicks( tickInterval, minorStepInterval );
|
||||
|
||||
return QwtScaleDiv( rangeStart, rangeEnd, minorTicks, minorTicks, majorTicks );
|
||||
}
|
||||
|
||||
@@ -28,5 +28,14 @@
|
||||
class RiuQwtLinearScaleEngine : public QwtLinearScaleEngine
|
||||
{
|
||||
public:
|
||||
QwtScaleDiv divideScaleWithExplicitIntervals( double x1, double x2, double majorStepInterval, double minorStepInterval );
|
||||
QwtScaleDiv divideScaleWithExplicitIntervals( double tickStart,
|
||||
double tickEnd,
|
||||
double majorStepInterval,
|
||||
double minorStepInterval );
|
||||
QwtScaleDiv divideScaleWithExplicitIntervalsAndRange( double tickStart,
|
||||
double tickEnd,
|
||||
double majorStepInterval,
|
||||
double minorStepInterval,
|
||||
double rangeStart,
|
||||
double rangeEnd );
|
||||
};
|
||||
|
||||
@@ -162,11 +162,11 @@ int RiuQwtPlotWidget::axisValueFontSize( QwtPlot::Axis axis ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setAxisFontsAndAlignment( QwtPlot::Axis axis,
|
||||
int titleFontSize,
|
||||
int valueFontSize,
|
||||
bool titleBold,
|
||||
Qt::AlignmentFlag alignment )
|
||||
void RiuQwtPlotWidget::setAxisFontsAndAlignment( QwtPlot::Axis axis,
|
||||
int titleFontSize,
|
||||
int valueFontSize,
|
||||
bool titleBold,
|
||||
int alignment )
|
||||
{
|
||||
// Axis number font
|
||||
QFont axisFont = this->axisFont( axis );
|
||||
@@ -308,10 +308,10 @@ void RiuQwtPlotWidget::setAxisInverted( QwtPlot::Axis axis )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setAxisLabelsAndTicksEnabled( QwtPlot::Axis axis, bool enable )
|
||||
void RiuQwtPlotWidget::setAxisLabelsAndTicksEnabled( QwtPlot::Axis axis, bool enableLabels, bool enableTicks )
|
||||
{
|
||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Ticks, enable );
|
||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Labels, enable );
|
||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Ticks, enableTicks );
|
||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Labels, enableLabels );
|
||||
recalculateAxisExtents( axis );
|
||||
}
|
||||
|
||||
@@ -360,6 +360,31 @@ void RiuQwtPlotWidget::setMajorAndMinorTickIntervals( QwtPlot::Axis axis,
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setMajorAndMinorTickIntervalsAndRange( QwtPlot::Axis axis,
|
||||
double majorTickInterval,
|
||||
double minorTickInterval,
|
||||
double minTickValue,
|
||||
double maxTickValue,
|
||||
double rangeMin,
|
||||
double rangeMax )
|
||||
{
|
||||
RiuQwtLinearScaleEngine* scaleEngine = dynamic_cast<RiuQwtLinearScaleEngine*>( this->axisScaleEngine( axis ) );
|
||||
if ( scaleEngine )
|
||||
{
|
||||
QwtScaleDiv scaleDiv = scaleEngine->divideScaleWithExplicitIntervalsAndRange( minTickValue,
|
||||
maxTickValue,
|
||||
majorTickInterval,
|
||||
minorTickInterval,
|
||||
rangeMin,
|
||||
rangeMax );
|
||||
|
||||
this->setAxisScaleDiv( axis, scaleDiv );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -71,10 +71,10 @@ public:
|
||||
int axisTitleFontSize( QwtPlot::Axis axis ) const;
|
||||
int axisValueFontSize( QwtPlot::Axis axis ) const;
|
||||
void setAxisFontsAndAlignment( QwtPlot::Axis,
|
||||
int titleFontSize,
|
||||
int valueFontSize,
|
||||
bool titleBold = false,
|
||||
Qt::AlignmentFlag alignment = Qt::AlignRight );
|
||||
int titleFontSize,
|
||||
int valueFontSize,
|
||||
bool titleBold = false,
|
||||
int alignment = (int)Qt::AlignRight );
|
||||
|
||||
void setAxisTitleText( QwtPlot::Axis axis, const QString& title );
|
||||
void setAxisTitleEnabled( QwtPlot::Axis axis, bool enable );
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void setAxisRange( QwtPlot::Axis axis, double min, double max );
|
||||
|
||||
void setAxisInverted( QwtPlot::Axis axis );
|
||||
void setAxisLabelsAndTicksEnabled( QwtPlot::Axis axis, bool enable );
|
||||
void setAxisLabelsAndTicksEnabled( QwtPlot::Axis axis, bool enableLabels, bool enableTicks );
|
||||
|
||||
void enableGridLines( QwtPlot::Axis axis, bool majorGridLines, bool minorGridLines );
|
||||
|
||||
@@ -100,6 +100,13 @@ public:
|
||||
double minorTickInterval,
|
||||
double minValue,
|
||||
double maxValue );
|
||||
void setMajorAndMinorTickIntervalsAndRange( QwtPlot::Axis axis,
|
||||
double majorTickInterval,
|
||||
double minorTickInterval,
|
||||
double minTickValue,
|
||||
double maxTickValue,
|
||||
double rangeMin,
|
||||
double rangeMax );
|
||||
void setAutoTickIntervalCounts( QwtPlot::Axis axis, int maxMajorTickIntervalCount, int maxMinorTickIntervalCount );
|
||||
double majorTickInterval( QwtPlot::Axis axis ) const;
|
||||
double minorTickInterval( QwtPlot::Axis axis ) const;
|
||||
|
||||
Reference in New Issue
Block a user