25 mCategoryBrush.setStyle( Qt::SolidPattern );
26 mPen.setStyle( Qt::SolidLine );
46 attrVal = expression->
evaluate( feature );
53 if ( !attrVal.isValid() )
58 double scaledValue = attrVal.toDouble();
61 double scaledLowerSizeWidth = is.
lowerSize.width();
62 double scaledLowerSizeHeight = is.
lowerSize.height();
63 double scaledUpperSizeWidth = is.
upperSize.width();
64 double scaledUpperSizeHeight = is.
upperSize.height();
69 scaledValue = sqrt( scaledValue );
70 scaledLowerValue = sqrt( scaledLowerValue );
71 scaledUpperValue = sqrt( scaledUpperValue );
72 scaledLowerSizeWidth = sqrt( scaledLowerSizeWidth );
73 scaledLowerSizeHeight = sqrt( scaledLowerSizeHeight );
74 scaledUpperSizeWidth = sqrt( scaledUpperSizeWidth );
75 scaledUpperSizeHeight = sqrt( scaledUpperSizeHeight );
79 double scaledRatio = ( scaledValue - scaledLowerValue ) / ( scaledUpperValue - scaledLowerValue );
88 if ( size.width() == size.height() )
95 size.setWidth( size.height() );
104 Q_UNUSED( attributes );
108 int QgsPieDiagram::sCount = 0;
119 QList<double> values;
120 double currentVal = 0;
128 currentVal = expression->
evaluate( feature ).toDouble();
129 values.push_back( currentVal );
130 valSum += currentVal;
131 if ( currentVal ) valCount++;
135 double totalAngle = 0;
140 double w = spu.width();
141 double h = spu.height();
143 double baseX = position.x();
144 double baseY = position.y() - h;
153 QList<double>::const_iterator valIt = values.constBegin();
154 QList< QColor >::const_iterator colIt = s.
categoryColors.constBegin();
155 for ( ; valIt != values.constEnd(); ++valIt, ++colIt )
159 currentAngle = *valIt / valSum * 360 * 16;
160 mCategoryBrush.setColor( *colIt );
161 p->setBrush( mCategoryBrush );
165 p->drawEllipse( baseX, baseY, w, h );
169 p->drawPie( baseX, baseY, w, h, totalAngle + s.
angleOffset, currentAngle );
171 totalAngle += currentAngle;
178 mCategoryBrush.setColor( Qt::transparent );
179 p->setBrush( mCategoryBrush );
180 p->drawEllipse( baseX, baseY, w, h );