.TH "QwtPlotHistogram" 3 "Wed Jan 2 2019" "Version 6.1.4" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtPlotHistogram \- \fBQwtPlotHistogram\fP represents a series of samples, where an interval is associated with a value ( $y = f([x1,x2])$ )\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtPlotSeriesItem\fP, and \fBQwtSeriesStore< QwtIntervalSample >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBHistogramStyle\fP { \fBOutline\fP, \fBColumns\fP, \fBLines\fP, \fBUserStyle\fP = 100 }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtPlotHistogram\fP (const QString &\fBtitle\fP=QString())" .br .ti -1c .RI "\fBQwtPlotHistogram\fP (const \fBQwtText\fP &\fBtitle\fP)" .br .ti -1c .RI "virtual \fB~QwtPlotHistogram\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "virtual int \fBrtti\fP () const" .br .ti -1c .RI "void \fBsetPen\fP (const QColor &, qreal width=0\&.0, Qt::PenStyle=Qt::SolidLine)" .br .ti -1c .RI "void \fBsetPen\fP (const QPen &)" .br .ti -1c .RI "const QPen & \fBpen\fP () const" .br .ti -1c .RI "void \fBsetBrush\fP (const QBrush &)" .br .ti -1c .RI "const QBrush & \fBbrush\fP () const" .br .ti -1c .RI "void \fBsetSamples\fP (const QVector< \fBQwtIntervalSample\fP > &)" .br .ti -1c .RI "void \fBsetSamples\fP (\fBQwtSeriesData\fP< \fBQwtIntervalSample\fP > *)" .br .ti -1c .RI "void \fBsetBaseline\fP (double)" .br .RI "Set the value of the baseline\&. " .ti -1c .RI "double \fBbaseline\fP () const" .br .ti -1c .RI "void \fBsetStyle\fP (\fBHistogramStyle\fP \fBstyle\fP)" .br .ti -1c .RI "\fBHistogramStyle\fP \fBstyle\fP () const" .br .ti -1c .RI "void \fBsetSymbol\fP (const \fBQwtColumnSymbol\fP *)" .br .RI "Assign a symbol\&. " .ti -1c .RI "const \fBQwtColumnSymbol\fP * \fBsymbol\fP () const" .br .ti -1c .RI "virtual void \fBdrawSeries\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, int from, int to) const" .br .ti -1c .RI "virtual QRectF \fBboundingRect\fP () const" .br .ti -1c .RI "virtual \fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual \fBQwtColumnRect\fP \fBcolumnRect\fP (const \fBQwtIntervalSample\fP &, const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &) const" .br .ti -1c .RI "virtual void \fBdrawColumn\fP (QPainter *, const \fBQwtColumnRect\fP &, const \fBQwtIntervalSample\fP &) const" .br .ti -1c .RI "void \fBdrawColumns\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, int from, int to) const" .br .ti -1c .RI "void \fBdrawOutline\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, int from, int to) const" .br .ti -1c .RI "void \fBdrawLines\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, int from, int to) const" .br .in -1c .SH "Detailed Description" .PP \fBQwtPlotHistogram\fP represents a series of samples, where an interval is associated with a value ( $y = f([x1,x2])$ )\&. The representation depends on the \fBstyle()\fP and an optional \fBsymbol()\fP that is displayed for each interval\&. .PP \fBNote:\fP .RS 4 The term 'histogram' is used in a different way in the areas of digital image processing and statistics\&. Wikipedia introduces the terms 'image histogram' and 'color histogram' to avoid confusions\&. While 'image histograms' can be displayed by a \fBQwtPlotCurve\fP there is no applicable plot item for a 'color histogram' yet\&. .RE .PP \fBSee also:\fP .RS 4 \fBQwtPlotBarChart\fP, \fBQwtPlotMultiBarChart\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtPlotHistogram::HistogramStyle\fP" Histogram styles\&. The default style is \fBQwtPlotHistogram::Columns\fP\&. .PP \fBSee also:\fP .RS 4 \fBsetStyle()\fP, \fBstyle()\fP, \fBsetSymbol()\fP, \fBsymbol()\fP, \fBsetBaseline()\fP .RE .PP .PP \fBEnumerator\fP .in +1c .TP \fB\fIOutline \fP\fP Draw an outline around the area, that is build by all intervals using the \fBpen()\fP and fill it with the \fBbrush()\fP\&. The outline style requires, that the intervals are in increasing order and not overlapping\&. .TP \fB\fIColumns \fP\fP Draw a column for each interval\&. When a \fBsymbol()\fP has been set the symbol is used otherwise the column is displayed as plain rectangle using \fBpen()\fP and \fBbrush()\fP\&. .TP \fB\fILines \fP\fP Draw a simple line using the \fBpen()\fP for each interval\&. .TP \fB\fIUserStyle \fP\fP Styles >= UserStyle are reserved for derived classes that overload \fBdrawSeries()\fP with additional application specific ways to display a histogram\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtPlotHistogram::QwtPlotHistogram (const QString & title = \fCQString()\fP)\fC [explicit]\fP" Constructor .PP \fBParameters:\fP .RS 4 \fItitle\fP Title of the histogram\&. .RE .PP .SS "QwtPlotHistogram::QwtPlotHistogram (const \fBQwtText\fP & title)\fC [explicit]\fP" Constructor .PP \fBParameters:\fP .RS 4 \fItitle\fP Title of the histogram\&. .RE .PP .SH "Member Function Documentation" .PP .SS "double QwtPlotHistogram::baseline () const" .PP \fBReturns:\fP .RS 4 Value of the baseline .RE .PP \fBSee also:\fP .RS 4 \fBsetBaseline()\fP .RE .PP .SS "QRectF QwtPlotHistogram::boundingRect () const\fC [virtual]\fP" .PP \fBReturns:\fP .RS 4 Bounding rectangle of all samples\&. For an empty series the rectangle is invalid\&. .RE .PP .PP Reimplemented from \fBQwtPlotSeriesItem\fP\&. .SS "const QBrush & QwtPlotHistogram::brush () const" .PP \fBReturns:\fP .RS 4 Brush used in a \fBstyle()\fP depending way\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetPen()\fP, \fBbrush()\fP .RE .PP .SS "\fBQwtColumnRect\fP QwtPlotHistogram::columnRect (const \fBQwtIntervalSample\fP & sample, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap) const\fC [protected]\fP, \fC [virtual]\fP" Calculate the area that is covered by a sample .PP \fBParameters:\fP .RS 4 \fIsample\fP Sample .br \fIxMap\fP Maps x-values into pixel coordinates\&. .br \fIyMap\fP Maps y-values into pixel coordinates\&. .RE .PP \fBReturns:\fP .RS 4 Rectangle, that is covered by a sample .RE .PP .SS "void QwtPlotHistogram::drawColumn (QPainter * painter, const \fBQwtColumnRect\fP & rect, const \fBQwtIntervalSample\fP & sample) const\fC [protected]\fP, \fC [virtual]\fP" Draw a column for a sample in Columns \fBstyle()\fP\&. .PP When a \fBsymbol()\fP has been set the symbol is used otherwise the column is displayed as plain rectangle using \fBpen()\fP and \fBbrush()\fP\&. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIrect\fP Rectangle where to paint the column in paint device coordinates .br \fIsample\fP Sample to be displayed .RE .PP \fBNote:\fP .RS 4 In applications, where different intervals need to be displayed in a different way ( f\&.e different colors or even using different symbols) it is recommended to overload \fBdrawColumn()\fP\&. .RE .PP .SS "void QwtPlotHistogram::drawColumns (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, int from, int to) const\fC [protected]\fP" Draw a histogram in Columns \fBstyle()\fP .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIxMap\fP Maps x-values into pixel coordinates\&. .br \fIyMap\fP Maps y-values into pixel coordinates\&. .br \fIfrom\fP Index of the first sample to be painted .br \fIto\fP Index of the last sample to be painted\&. If to < 0 the histogram will be painted to its last point\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetStyle()\fP, \fBstyle()\fP, \fBsetSymbol()\fP, \fBdrawColumn()\fP .RE .PP .SS "void QwtPlotHistogram::drawLines (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, int from, int to) const\fC [protected]\fP" Draw a histogram in Lines \fBstyle()\fP .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIxMap\fP Maps x-values into pixel coordinates\&. .br \fIyMap\fP Maps y-values into pixel coordinates\&. .br \fIfrom\fP Index of the first sample to be painted .br \fIto\fP Index of the last sample to be painted\&. If to < 0 the histogram will be painted to its last point\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetStyle()\fP, \fBstyle()\fP, \fBsetPen()\fP .RE .PP .SS "void QwtPlotHistogram::drawOutline (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, int from, int to) const\fC [protected]\fP" Draw a histogram in Outline \fBstyle()\fP .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIxMap\fP Maps x-values into pixel coordinates\&. .br \fIyMap\fP Maps y-values into pixel coordinates\&. .br \fIfrom\fP Index of the first sample to be painted .br \fIto\fP Index of the last sample to be painted\&. If to < 0 the histogram will be painted to its last point\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetStyle()\fP, \fBstyle()\fP .RE .PP \fBWarning:\fP .RS 4 The outline style requires, that the intervals are in increasing order and not overlapping\&. .RE .PP .SS "void QwtPlotHistogram::drawSeries (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect, int from, int to) const\fC [virtual]\fP" Draw a subset of the histogram samples .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIxMap\fP Maps x-values into pixel coordinates\&. .br \fIyMap\fP Maps y-values into pixel coordinates\&. .br \fIcanvasRect\fP Contents rectangle of the canvas .br \fIfrom\fP Index of the first sample to be painted .br \fIto\fP Index of the last sample to be painted\&. If to < 0 the series will be painted to its last sample\&. .RE .PP \fBSee also:\fP .RS 4 \fBdrawOutline()\fP, \fBdrawLines()\fP, \fBdrawColumns\fP .RE .PP .PP Implements \fBQwtPlotSeriesItem\fP\&. .SS "\fBQwtGraphic\fP QwtPlotHistogram::legendIcon (int index, const QSizeF & size) const\fC [virtual]\fP" A plain rectangle without pen using the \fBbrush()\fP .PP \fBParameters:\fP .RS 4 \fIindex\fP Index of the legend entry ( ignored as there is only one ) .br \fIsize\fP Icon size .RE .PP \fBReturns:\fP .RS 4 A graphic displaying the icon .RE .PP \fBSee also:\fP .RS 4 \fBQwtPlotItem::setLegendIconSize()\fP, \fBQwtPlotItem::legendData()\fP .RE .PP .PP Reimplemented from \fBQwtPlotItem\fP\&. .SS "const QPen & QwtPlotHistogram::pen () const" .PP \fBReturns:\fP .RS 4 Pen used in a \fBstyle()\fP depending way\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetPen()\fP, \fBbrush()\fP .RE .PP .SS "int QwtPlotHistogram::rtti () const\fC [virtual]\fP" .PP \fBReturns:\fP .RS 4 \fBQwtPlotItem::Rtti_PlotHistogram\fP .RE .PP .PP Reimplemented from \fBQwtPlotItem\fP\&. .SS "void QwtPlotHistogram::setBaseline (double value)" .PP Set the value of the baseline\&. Each column representing an \fBQwtIntervalSample\fP is defined by its interval and the interval between baseline and the value of the sample\&. .PP The default value of the baseline is 0\&.0\&. .PP \fBParameters:\fP .RS 4 \fIvalue\fP Value of the baseline .RE .PP \fBSee also:\fP .RS 4 \fBbaseline()\fP .RE .PP .SS "void QwtPlotHistogram::setBrush (const QBrush & brush)" Assign a brush, that is used in a \fBstyle()\fP depending way\&. .PP \fBParameters:\fP .RS 4 \fIbrush\fP New brush .RE .PP \fBSee also:\fP .RS 4 \fBpen()\fP, \fBbrush()\fP .RE .PP .SS "void QwtPlotHistogram::setPen (const QColor & color, qreal width = \fC0\&.0\fP, Qt::PenStyle style = \fCQt::SolidLine\fP)" Build and assign a pen .PP In Qt5 the default pen width is 1\&.0 ( 0\&.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() )\&. This method has been introduced to hide this incompatibility\&. .PP \fBParameters:\fP .RS 4 \fIcolor\fP Pen color .br \fIwidth\fP Pen width .br \fIstyle\fP Pen style .RE .PP \fBSee also:\fP .RS 4 \fBpen()\fP, \fBbrush()\fP .RE .PP .SS "void QwtPlotHistogram::setPen (const QPen & pen)" Assign a pen, that is used in a \fBstyle()\fP depending way\&. .PP \fBParameters:\fP .RS 4 \fIpen\fP New pen .RE .PP \fBSee also:\fP .RS 4 \fBpen()\fP, \fBbrush()\fP .RE .PP .SS "void QwtPlotHistogram::setSamples (const QVector< \fBQwtIntervalSample\fP > & samples)" Initialize data with an array of samples\&. .PP \fBParameters:\fP .RS 4 \fIsamples\fP Vector of points .RE .PP .SS "void QwtPlotHistogram::setSamples (\fBQwtSeriesData\fP< \fBQwtIntervalSample\fP > * data)" Assign a series of samples .PP \fBsetSamples()\fP is just a wrapper for \fBsetData()\fP without any additional value - beside that it is easier to find for the developer\&. .PP \fBParameters:\fP .RS 4 \fIdata\fP Data .RE .PP \fBWarning:\fP .RS 4 The item takes ownership of the data object, deleting it when its not used anymore\&. .RE .PP .SS "void QwtPlotHistogram::setStyle (\fBHistogramStyle\fP style)" Set the histogram's drawing style .PP \fBParameters:\fP .RS 4 \fIstyle\fP Histogram style .RE .PP \fBSee also:\fP .RS 4 \fBHistogramStyle\fP, \fBstyle()\fP .RE .PP .SS "void QwtPlotHistogram::setSymbol (const \fBQwtColumnSymbol\fP * symbol)" .PP Assign a symbol\&. In Column style an optional symbol can be assigned, that is responsible for displaying the rectangle that is defined by the interval and the distance between \fBbaseline()\fP and value\&. When no symbol has been defined the area is displayed as plain rectangle using \fBpen()\fP and \fBbrush()\fP\&. .PP \fBSee also:\fP .RS 4 \fBstyle()\fP, \fBsymbol()\fP, \fBdrawColumn()\fP, \fBpen()\fP, \fBbrush()\fP .RE .PP \fBNote:\fP .RS 4 In applications, where different intervals need to be displayed in a different way ( f\&.e different colors or even using different symbols) it is recommended to overload \fBdrawColumn()\fP\&. .RE .PP .SS "\fBQwtPlotHistogram::HistogramStyle\fP QwtPlotHistogram::style () const" .PP \fBReturns:\fP .RS 4 Style of the histogram .RE .PP \fBSee also:\fP .RS 4 \fBHistogramStyle\fP, \fBsetStyle()\fP .RE .PP .SS "const \fBQwtColumnSymbol\fP * QwtPlotHistogram::symbol () const" .PP \fBReturns:\fP .RS 4 Current symbol or NULL, when no symbol has been assigned .RE .PP \fBSee also:\fP .RS 4 \fBsetSymbol()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.