@@ -31,6 +31,7 @@ QgsHistogramDiagram::~QgsHistogramDiagram()
31
31
32
32
QSizeF QgsHistogramDiagram::diagramSize ( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is )
33
33
{
34
+ Q_UNUSED ( c );
34
35
QgsAttributeMap::const_iterator attIt = attributes.constBegin ();
35
36
if ( attIt == attributes.constEnd () )
36
37
{
@@ -50,16 +51,16 @@ QSizeF QgsHistogramDiagram::diagramSize( const QgsAttributeMap& attributes, cons
50
51
maxValue = s.minimumSize ;
51
52
}
52
53
53
- mScaleFactor = ( maxValue - is.lowerValue ) / ( is.upperValue - is.lowerValue );
54
-
55
54
switch ( s.diagramOrientation )
56
55
{
57
56
case QgsDiagramSettings::Up:
58
57
case QgsDiagramSettings::Down:
58
+ mScaleFactor = ( ( is.upperSize .width () - is.lowerSize .height () ) / ( is.upperValue - is.lowerValue ) );
59
59
return QSizeF ( s.barWidth * attributes.size (), maxValue * mScaleFactor );
60
60
61
61
case QgsDiagramSettings::Right:
62
62
case QgsDiagramSettings::Left:
63
+ mScaleFactor = ( ( is.upperSize .width () - is.lowerSize .width () ) / ( is.upperValue - is.lowerValue ) );
63
64
return QSizeF ( maxValue * mScaleFactor , s.barWidth * attributes.size () );
64
65
}
65
66
@@ -68,6 +69,7 @@ QSizeF QgsHistogramDiagram::diagramSize( const QgsAttributeMap& attributes, cons
68
69
69
70
QSizeF QgsHistogramDiagram::diagramSize ( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s )
70
71
{
72
+ Q_UNUSED ( c );
71
73
QgsAttributeMap::const_iterator attIt = attributes.constBegin ();
72
74
if ( attIt == attributes.constEnd () )
73
75
{
@@ -154,4 +156,4 @@ void QgsHistogramDiagram::renderDiagram( const QgsAttributeMap& att, QgsRenderCo
154
156
155
157
currentOffset += scaledWidth;
156
158
}
157
- }
159
+ }
0 commit comments