mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
Histogram: Use vertical labels.
This commit is contained in:
1 parent
9066dd0011
commit
e095f524c8
3 files changed
+30
-7
No files matched your search
@@ -291,7 +291,9 @@ void RimHistogramCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
Qt::PenStyle::DashDotDotLine,
|
||||
value,
|
||||
RiaDefines::Orientation::VERTICAL,
|
||||
Qt::AlignmentFlag::AlignCenter );
|
||||
Qt::AlignmentFlag::AlignLeft,
|
||||
3,
|
||||
RiaDefines::Orientation::VERTICAL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RiuPlotAnnotationTool.h"
|
||||
|
||||
#include "RiaPlotDefines.h"
|
||||
#include "RimPlotAxisAnnotation.h"
|
||||
#include "RiuGuiTheme.h"
|
||||
#include "RiuQwtPlotCurveDefines.h"
|
||||
@@ -193,7 +194,9 @@ void RiuPlotAnnotationTool::attachAnnotationLine( QwtPlot* plot,
|
||||
Qt::PenStyle penStyle,
|
||||
const double position,
|
||||
RiaDefines::Orientation orientation,
|
||||
Qt::Alignment horizontalAlignment )
|
||||
Qt::Alignment horizontalAlignment,
|
||||
int lineWidth,
|
||||
RiaDefines::Orientation labelOrientation )
|
||||
{
|
||||
m_plot = plot;
|
||||
|
||||
@@ -205,7 +208,17 @@ void RiuPlotAnnotationTool::attachAnnotationLine( QwtPlot* plot,
|
||||
textColor = RiuGuiTheme::getColorByVariableName( "textColor" );
|
||||
}
|
||||
|
||||
RiuPlotAnnotationTool::setLineProperties( line, annotationText, orientation, position, penStyle, color, textColor, horizontalAlignment );
|
||||
RiuPlotAnnotationTool::setLineProperties( line,
|
||||
annotationText,
|
||||
orientation,
|
||||
position,
|
||||
penStyle,
|
||||
color,
|
||||
textColor,
|
||||
horizontalAlignment,
|
||||
0,
|
||||
lineWidth,
|
||||
labelOrientation );
|
||||
m_plotItems.push_back( line );
|
||||
line->attach( m_plot );
|
||||
}
|
||||
@@ -413,12 +426,14 @@ void RiuPlotAnnotationTool::setLineProperties( QwtPlotMarker* line,
|
||||
const QColor& color /*= QColor( 0, 0, 100 )*/,
|
||||
const QColor& textColor /*= QColor( 0, 0, 100 )*/,
|
||||
Qt::Alignment horizontalAlignment /*= Qt::AlignRight*/,
|
||||
int fontSize /*= 0 */ )
|
||||
int fontSize /*= 0 */,
|
||||
int lineWidth,
|
||||
RiaDefines::Orientation labelOrientation )
|
||||
{
|
||||
QPen curvePen;
|
||||
curvePen.setStyle( lineStyle );
|
||||
curvePen.setColor( color );
|
||||
curvePen.setWidth( 1 );
|
||||
curvePen.setWidth( lineWidth );
|
||||
|
||||
line->setLinePen( curvePen );
|
||||
QwtText label( name );
|
||||
@@ -427,6 +442,8 @@ void RiuPlotAnnotationTool::setLineProperties( QwtPlotMarker* line,
|
||||
line->setLabel( label );
|
||||
line->setLabelAlignment( horizontalAlignment | Qt::AlignBottom );
|
||||
|
||||
line->setLabelOrientation( labelOrientation == RiaDefines::Orientation::HORIZONTAL ? Qt::Horizontal : Qt::Vertical );
|
||||
|
||||
if ( orientation == RiaDefines::Orientation::HORIZONTAL )
|
||||
{
|
||||
line->setLineStyle( QwtPlotMarker::HLine );
|
||||
|
||||
@@ -59,7 +59,9 @@ public:
|
||||
Qt::PenStyle penStyle,
|
||||
const double position,
|
||||
RiaDefines::Orientation orientation,
|
||||
Qt::Alignment horizontalAlignment );
|
||||
Qt::Alignment horizontalAlignment,
|
||||
int lineWidth = 1,
|
||||
RiaDefines::Orientation labelOrientation = RiaDefines::Orientation::HORIZONTAL );
|
||||
|
||||
void attachAnnotationRange( QwtPlot* plot,
|
||||
const QColor& color,
|
||||
@@ -95,7 +97,9 @@ private:
|
||||
const QColor& color = QColor( 0, 0, 100 ),
|
||||
const QColor& textColor = QColor( 0, 0, 100 ),
|
||||
Qt::Alignment horizontalAlignment = Qt::AlignRight,
|
||||
int fontSize = 0 );
|
||||
int fontSize = 0,
|
||||
int lineWidth = 1,
|
||||
RiaDefines::Orientation labelOrientation = RiaDefines::Orientation::HORIZONTAL );
|
||||
|
||||
private:
|
||||
QPointer<QwtPlot> m_plot;
|
||||
|
||||
Reference in new issue
Block a user