QGIS API Documentation
3.4.15-Madeira (e83d02e274)
|
Graphical histogram for displaying distributions of field values. More...
#include <qgshistogramwidget.h>
Public Slots | |
void | refresh () |
Redraws the histogram. More... | |
void | refreshValues () |
Refreshes the values for the histogram by fetching them from the layer. More... | |
void | setLayer (QgsVectorLayer *layer) |
Sets the vector layer associated with the histogram. More... | |
void | setSourceFieldExp (const QString &fieldOrExp) |
Sets the source field or expression to use for values in the histogram. More... | |
Public Member Functions | |
QgsHistogramWidget (QWidget *parent=nullptr, QgsVectorLayer *layer=nullptr, const QString &fieldOrExp=QString()) | |
QgsHistogramWidget constructor. More... | |
~QgsHistogramWidget () override | |
QBrush | brush () const |
Returns the brush used when drawing histogram bars. More... | |
QgsRangeList | graduatedRanges () const |
Returns the graduated ranges associated with the histogram. More... | |
QgsVectorLayer * | layer () |
Returns the layer currently associated with the widget. More... | |
QPen | pen () const |
Returns the pen used when drawing histogram bars. More... | |
void | setBrush (const QBrush &brush) |
Sets the brush used for drawing histogram bars. More... | |
void | setGraduatedRanges (const QgsRangeList &ranges) |
Sets the graduated ranges associated with the histogram. More... | |
void | setPen (const QPen &pen) |
Sets the pen to use when drawing histogram bars. More... | |
void | setXAxisTitle (const QString &title) |
Sets the title for the histogram's x-axis. More... | |
void | setYAxisTitle (const QString &title) |
Sets the title for the histogram's y-axis. More... | |
QString | sourceFieldExp () const |
Returns the source field name or expression used to calculate values displayed in the histogram. More... | |
QString | xAxisTitle () const |
Returns the title for the histogram's x-axis. More... | |
QString | yAxisTitle () const |
Returns the title for the histogram's y-axis. More... | |
Protected Member Functions | |
virtual void | drawHistogram () |
Updates and redraws the histogram. More... | |
Protected Attributes | |
QwtPlot * | mPlot = nullptr |
QList< QwtPlotMarker * > | mRangeMarkers |
QgsRangeList | mRanges |
Graphical histogram for displaying distributions of field values.
Definition at line 49 of file qgshistogramwidget.h.
QgsHistogramWidget::QgsHistogramWidget | ( | QWidget * | parent = nullptr , |
QgsVectorLayer * | layer = nullptr , |
||
const QString & | fieldOrExp = QString() |
||
) |
QgsHistogramWidget constructor.
If layer and fieldOrExp are specified then the histogram will be initially populated with the corresponding values.
parent | parent widget |
layer | source vector layer |
fieldOrExp | field name or expression string |
Definition at line 42 of file qgshistogramwidget.cpp.
|
override |
Definition at line 79 of file qgshistogramwidget.cpp.
|
inline |
Returns the brush used when drawing histogram bars.
Definition at line 112 of file qgshistogramwidget.h.
|
protectedvirtual |
Updates and redraws the histogram.
Reimplemented in QgsGraduatedHistogramWidget.
Definition at line 171 of file qgshistogramwidget.cpp.
|
inline |
Returns the graduated ranges associated with the histogram.
If set, the ranges will be used to color the histogram bars and for showing vertical dividers at the histogram breaks.
Definition at line 128 of file qgshistogramwidget.h.
|
inline |
Returns the layer currently associated with the widget.
Definition at line 71 of file qgshistogramwidget.h.
|
inline |
Returns the pen used when drawing histogram bars.
Definition at line 96 of file qgshistogramwidget.h.
|
slot |
Redraws the histogram.
Calling this slot does not update the values for the histogram, use refreshValues() to do this.
Definition at line 136 of file qgshistogramwidget.cpp.
|
slot |
Refreshes the values for the histogram by fetching them from the layer.
Definition at line 97 of file qgshistogramwidget.cpp.
|
inline |
Sets the brush used for drawing histogram bars.
If ranges have been set using setGraduatedRanges() then the pen and brush will have no effect.
brush | histogram brush |
Definition at line 105 of file qgshistogramwidget.h.
void QgsHistogramWidget::setGraduatedRanges | ( | const QgsRangeList & | ranges | ) |
Sets the graduated ranges associated with the histogram.
If set, the ranges will be used to color the histogram bars and for showing vertical dividers at the histogram breaks.
ranges | graduated range list |
Definition at line 91 of file qgshistogramwidget.cpp.
|
slot |
Sets the vector layer associated with the histogram.
layer | source vector layer |
Definition at line 141 of file qgshistogramwidget.cpp.
|
inline |
Sets the pen to use when drawing histogram bars.
If set to Qt::NoPen then the pen will be automatically calculated. If ranges have been set using setGraduatedRanges() then the pen and brush will have no effect.
pen | histogram pen |
Definition at line 89 of file qgshistogramwidget.h.
|
slot |
Sets the source field or expression to use for values in the histogram.
fieldOrExp | field name or expression string |
Definition at line 162 of file qgshistogramwidget.cpp.
|
inline |
Sets the title for the histogram's x-axis.
title | x-axis title, or empty string to remove title |
Definition at line 143 of file qgshistogramwidget.h.
|
inline |
Sets the title for the histogram's y-axis.
title | y-axis title, or empty string to remove title |
Definition at line 158 of file qgshistogramwidget.h.
|
inline |
Returns the source field name or expression used to calculate values displayed in the histogram.
Definition at line 79 of file qgshistogramwidget.h.
|
inline |
Returns the title for the histogram's x-axis.
Definition at line 135 of file qgshistogramwidget.h.
|
inline |
Returns the title for the histogram's y-axis.
Definition at line 150 of file qgshistogramwidget.h.
|
protected |
Definition at line 194 of file qgshistogramwidget.h.
|
protected |
Definition at line 196 of file qgshistogramwidget.h.
|
protected |
Definition at line 195 of file qgshistogramwidget.h.