|
QGIS API Documentation 4.3.0-Master (16eddb2670e)
|
Graphical histogram for displaying distributions of field values. More...
#include <qgshistogramwidget.h>

Public Slots | |
| void | refresh () |
| Redraws the histogram. | |
| void | refreshValues () |
| Refreshes the values for the histogram by fetching them from the layer. | |
| void | setLayer (QgsVectorLayer *layer) |
| Sets the vector layer associated with the histogram. | |
| void | setSourceFieldExp (const QString &fieldOrExp) |
| Sets the source field or expression to use for values in the histogram. | |
Public Member Functions | |
| QgsHistogramWidget (QWidget *parent=nullptr, QgsVectorLayer *layer=nullptr, const QString &fieldOrExp=QString()) | |
| QgsHistogramWidget constructor. | |
| ~QgsHistogramWidget () override | |
| QBrush | brush () const |
| Returns the brush used when drawing histogram bars. | |
| QgsRangeList | graduatedRanges () const |
| Returns the graduated ranges associated with the histogram. | |
| QgsVectorLayer * | layer () |
| Returns the layer currently associated with the widget. | |
| QPen | pen () const |
| Returns the pen used when drawing histogram bars. | |
| void | setBrush (const QBrush &brush) |
| Sets the brush used for drawing histogram bars. | |
| void | setGraduatedRanges (const QgsRangeList &ranges) |
| Sets the graduated ranges associated with the histogram. | |
| void | setPen (const QPen &pen) |
| Sets the pen to use when drawing histogram bars. | |
| void | setXAxisTitle (const QString &title) |
| Sets the title for the histogram's x-axis. | |
| void | setYAxisTitle (const QString &title) |
| Sets the title for the histogram's y-axis. | |
| QString | sourceFieldExp () const |
| Returns the source field name or expression used to calculate values displayed in the histogram. | |
| QString | xAxisTitle () const |
| Returns the title for the histogram's x-axis. | |
| QString | yAxisTitle () const |
| Returns the title for the histogram's y-axis. | |
Static Public Attributes | |
| static const QgsSettingsEntryBool * | settingsHistogramShowMean = new QgsSettingsEntryBool( u"histogram-show-mean"_s, QgsSettingsTree::sTreeHistogram, false ) |
| static const QgsSettingsEntryBool * | settingsHistogramShowStdev = new QgsSettingsEntryBool( u"histogram-show-stdev"_s, QgsSettingsTree::sTreeHistogram, false ) |
Protected Member Functions | |
| virtual void | drawHistogram () |
| Updates and redraws the histogram. | |
Protected Attributes | |
| QwtPlot * | mPlot = nullptr |
| QList< QwtPlotMarker * > | mRangeMarkers |
| QgsRangeList | mRanges |
Graphical histogram for displaying distributions of field values.
Definition at line 50 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 53 of file qgshistogramwidget.cpp.
|
override |
Definition at line 89 of file qgshistogramwidget.cpp.
|
inline |
Returns the brush used when drawing histogram bars.
Definition at line 115 of file qgshistogramwidget.h.
|
protectedvirtual |
Updates and redraws the histogram.
Reimplemented in QgsGraduatedHistogramWidget.
Definition at line 180 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 131 of file qgshistogramwidget.h.
|
inline |
Returns the layer currently associated with the widget.
Definition at line 74 of file qgshistogramwidget.h.
|
inline |
Returns the pen used when drawing histogram bars.
Definition at line 99 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 145 of file qgshistogramwidget.cpp.
|
slot |
Refreshes the values for the histogram by fetching them from the layer.
Definition at line 106 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 108 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 100 of file qgshistogramwidget.cpp.
|
slot |
Sets the vector layer associated with the histogram.
| layer | source vector layer |
Definition at line 150 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 92 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 171 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 146 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 161 of file qgshistogramwidget.h.
|
inline |
Returns the source field name or expression used to calculate values displayed in the histogram.
Definition at line 82 of file qgshistogramwidget.h.
|
inline |
Returns the title for the histogram's x-axis.
Definition at line 138 of file qgshistogramwidget.h.
|
inline |
Returns the title for the histogram's y-axis.
Definition at line 153 of file qgshistogramwidget.h.
|
protected |
Definition at line 196 of file qgshistogramwidget.h.
|
protected |
Definition at line 198 of file qgshistogramwidget.h.
|
protected |
Definition at line 197 of file qgshistogramwidget.h.
|
static |
Definition at line 66 of file qgshistogramwidget.h.
|
static |
Definition at line 67 of file qgshistogramwidget.h.