Histogram: Use vertical labels.

This commit is contained in:
Kristian Bendiksen committed 2025-07-03 08:35:10 +02:00
1 parent 9066dd0011
commit e095f524c8
3 files changed
+30 -7

No files matched your search

@@ -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 );