25 mCategoryBrush.
setStyle( Qt::SolidPattern );
51 attrVal = expression->
evaluate( &expressionContext );
63 double scaledValue = attrVal.
toDouble();
74 scaledValue = sqrt( scaledValue );
75 scaledLowerValue = sqrt( scaledLowerValue );
76 scaledUpperValue = sqrt( scaledUpperValue );
77 scaledLowerSizeWidth = sqrt( scaledLowerSizeWidth );
78 scaledLowerSizeHeight = sqrt( scaledLowerSizeHeight );
79 scaledUpperSizeWidth = sqrt( scaledUpperSizeWidth );
80 scaledUpperSizeHeight = sqrt( scaledUpperSizeHeight );
84 double scaledRatio = ( scaledValue - scaledLowerValue ) / ( scaledUpperValue - scaledLowerValue );
109 Q_UNUSED( attributes );
113 int QgsPieDiagram::sCount = 0;
125 double currentVal = 0;
140 valSum += currentVal;
141 if ( currentVal ) valCount++;
145 double totalAngle = 0;
150 double w = spu.
width();
153 double baseX = position.
x();
154 double baseY = position.
y() - h;
165 for ( ; valIt != values.
constEnd(); ++valIt, ++colIt )
169 currentAngle = *valIt / valSum * 360 * 16;
181 totalAngle += currentAngle;
188 mCategoryBrush.
setColor( Qt::transparent );
Class for parsing and evaluation of expressions (formerly called "search strings").
double minimumSize
Scale diagrams smaller than mMinimumSize to mMinimumSize.
void setStyle(Qt::PenStyle style)
void scale(qreal width, qreal height, Qt::AspectRatioMode mode)
Q_DECL_DEPRECATED QVariant evaluate(const QgsFeature *f)
Evaluate the feature and return the result.
void push_back(const T &value)
QList< QString > categoryAttributes
Q_DECL_DEPRECATED QgsExpression * getExpression(const QString &expression, const QgsFields *fields)
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
bool classificationAttributeIsExpression
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setStyle(Qt::BrushStyle style)
QSizeF sizePainterUnits(const QSizeF &size, const QgsDiagramSettings &s, const QgsRenderContext &c)
Calculates a size to match the current settings and rendering context.
void renderDiagram(const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, const QPointF &position) override
Draws the diagram at the given position (in pixel coordinates)
QgsAttributes attributes() const
Returns the feature's attributes.
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
void setWidth(qreal width)
QString classificationAttributeExpression
const QgsFields * fields() const
Returns the field map associated with the feature.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual QgsDiagram * clone() const override
Returns an instance that is equivalent to this one.
void setBrush(const QBrush &brush)
void setColor(const QColor &color)
void setFields(const QgsFields &fields)
Convenience function for setting a fields for the context.
Base class for all diagram types.
QgsExpressionContext & expressionContext()
Gets the expression context.
void drawPie(const QRectF &rectangle, int startAngle, int spanAngle)
const T & at(int i) const
Contains information about the context of a rendering operation.
double toDouble(bool *ok) const
int classificationAttribute
Index of the classification attribute.
const_iterator constEnd() const
const_iterator constBegin() const
void setPenWidth(QPen &pen, const QgsDiagramSettings &s, const QgsRenderContext &c)
Changes the pen width to match the current settings and rendering context.
QList< QColor > categoryColors
void setColor(const QColor &color)
QSizeF diagramSize(const QgsAttributes &attributes, const QgsRenderContext &c, const QgsDiagramSettings &s) override
Returns the size in map units the diagram will use to render.