24 mCategoryBrush.
setStyle( Qt::SolidPattern );
59 maxValue = qMax( expression->
evaluate( &expressionContext ).
toDouble(), maxValue );
98 return value * scaleFactor;
111 double maxValue = attributes.
at( 0 ).toDouble();
113 for (
int i = 0; i < attributes.
count(); ++i )
115 maxValue = qMax( attributes.
at( i ).toDouble(), maxValue );
129 mScaleFactor = maxValue / s.
size.
width();
158 maxValue = qMax( currentVal, maxValue );
163 double currentOffset = 0;
166 double baseX = position.
x();
167 double baseY = position.
y();
175 for ( ; valIt != values.
constEnd(); ++valIt, ++colIt )
185 p->
drawRect( baseX + currentOffset, baseY, scaledWidth, length * -1 );
189 p->
drawRect( baseX + currentOffset, baseY - scaledMaxVal, scaledWidth, length );
193 p->
drawRect( baseX, baseY - currentOffset, length, scaledWidth * -1 );
197 p->
drawRect( baseX + scaledMaxVal, baseY - currentOffset, 0 - length, scaledWidth * -1 );
201 currentOffset += scaledWidth;
QSizeF sizePainterUnits(QSizeF size, const QgsDiagramSettings &s, const QgsRenderContext &c)
Calculates a size to match the current settings and rendering context.
Class for parsing and evaluation of expressions (formerly called "search strings").
void renderDiagram(const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, QPointF position) override
Draws the diagram at the given position (in pixel coordinates)
QSizeF diagramSize(const QgsAttributes &attributes, const QgsRenderContext &c, const QgsDiagramSettings &s) override
Returns the size in map units the diagram will use to render.
double minimumSize
Scale diagrams smaller than mMinimumSize to mMinimumSize.
void setStyle(Qt::PenStyle style)
QgsAttributes attributes() const
Returns the feature's attributes.
void scale(qreal width, qreal height, Qt::AspectRatioMode mode)
Q_DECL_DEPRECATED QVariant evaluate(const QgsFeature *f)
Evaluate the feature and return the result.
virtual QgsHistogramDiagram * clone() const override
Returns an instance that is equivalent to this one.
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.
double legendSize(double value, const QgsDiagramSettings &s, const QgsDiagramInterpolationSettings &is) const override
Returns the size of the legend item for the diagram corresponding to a specified value.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setStyle(Qt::BrushStyle style)
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
void drawRect(const QRectF &rectangle)
DiagramOrientation diagramOrientation
const QgsFields * fields() const
Returns the field map associated with the feature.
void setPen(const QColor &color)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setBrush(const QBrush &brush)
void setColor(const QColor &color)
void setFields(const QgsFields &fields)
Convenience function for setting a fields for the context.
QgsExpressionContext & expressionContext()
Gets the expression context.
const T & at(int i) const
Additional diagram settings for interpolated size rendering.
Contains information about the context of a rendering operation.
int count(const T &value) const
double toDouble(bool *ok) const
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)
Stores the settings for rendering a single diagram.