QwtPlotHistogram(3) | Qwt User's Guide | QwtPlotHistogram(3) |
NAME
QwtPlotHistogram - QwtPlotHistogram represents a series of samples, where an interval is associated with a value ( $y = f([x1,x2])$ ).
SYNOPSIS
#include <qwt_plot_histogram.h>
Inherits QwtPlotSeriesItem, and QwtSeriesStore< QwtIntervalSample >.
Public Types
enum HistogramStyle { Outline, Columns,
Lines, UserStyle = 100 }
Public Member Functions
QwtPlotHistogram (const QString
&title=QString())
QwtPlotHistogram (const QwtText &title)
virtual ~QwtPlotHistogram ()
Destructor. virtual int rtti () const override
void setPen (const QColor &, qreal width=0.0,
Qt::PenStyle=Qt::SolidLine)
void setPen (const QPen &)
const QPen & pen () const
void setBrush (const QBrush &)
const QBrush & brush () const
void setSamples (const QVector< QwtIntervalSample >
&)
void setSamples (QwtSeriesData< QwtIntervalSample >
*)
void setBaseline (double)
Set the value of the baseline. double baseline () const
void setStyle (HistogramStyle style)
HistogramStyle style () const
void setSymbol (const QwtColumnSymbol *)
Assign a symbol. const QwtColumnSymbol * symbol () const
virtual void drawSeries (QPainter *, const QwtScaleMap
&xMap, const QwtScaleMap &yMap, const QRectF &canvasRect,
int from, int to) const override
virtual QRectF boundingRect () const override
virtual QwtGraphic legendIcon (int index, const QSizeF &)
const override
Protected Member Functions
virtual QwtColumnRect columnRect (const
QwtIntervalSample &, const QwtScaleMap &, const
QwtScaleMap &) const
virtual void drawColumn (QPainter *, const QwtColumnRect &,
const QwtIntervalSample &) const
void drawColumns (QPainter *, const QwtScaleMap &xMap, const
QwtScaleMap &yMap, int from, int to) const
void drawOutline (QPainter *, const QwtScaleMap &xMap, const
QwtScaleMap &yMap, int from, int to) const
void drawLines (QPainter *, const QwtScaleMap &xMap, const
QwtScaleMap &yMap, int from, int to) const
Detailed Description
QwtPlotHistogram represents a series of samples, where an interval is associated with a value ( $y = f([x1,x2])$ ).
The representation depends on the style() and an optional symbol() that is displayed for each interval.
Note
See also
Definition at line 41 of file qwt_plot_histogram.h.
Member Enumeration Documentation
enum QwtPlotHistogram::HistogramStyle
Histogram styles. The default style is QwtPlotHistogram::Columns.
See also
Enumerator
- Outline
- Draw an outline around the area, that is build by all intervals using the pen() and fill it with the brush(). The outline style requires, that the intervals are in increasing order and not overlapping.
- Columns
- Draw a column for each interval. When a symbol() has been set the symbol is used otherwise the column is displayed as plain rectangle using pen() and brush().
- Lines
- Draw a simple line using the pen() for each interval.
- UserStyle
- Styles >= UserStyle are reserved for derived classes that overload drawSeries() with additional application specific ways to display a histogram.
Definition at line 52 of file qwt_plot_histogram.h.
Constructor & Destructor Documentation
QwtPlotHistogram::QwtPlotHistogram (const QString & title = QString()) [explicit]
Constructor
Parameters
Definition at line 74 of file qwt_plot_histogram.cpp.
QwtPlotHistogram::QwtPlotHistogram (const QwtText & title) [explicit]
Constructor
Parameters
Definition at line 64 of file qwt_plot_histogram.cpp.
Member Function Documentation
double QwtPlotHistogram::baseline () const
Returns
See also
Definition at line 253 of file qwt_plot_histogram.cpp.
QRectF QwtPlotHistogram::boundingRect () const [override], [virtual]
Returns
Reimplemented from QwtPlotSeriesItem.
Definition at line 262 of file qwt_plot_histogram.cpp.
const QBrush & QwtPlotHistogram::brush () const
Returns
See also
Definition at line 189 of file qwt_plot_histogram.cpp.
QwtColumnRect QwtPlotHistogram::columnRect (const QwtIntervalSample & sample, const QwtScaleMap & xMap, const QwtScaleMap & yMap) const [protected], [virtual]
Calculate the area that is covered by a sample
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
Returns
Definition at line 602 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::drawColumn (QPainter * painter, const QwtColumnRect & rect, const QwtIntervalSample & sample) const [protected], [virtual]
Draw a column for a sample in Columns style().
When a symbol() has been set the symbol is used otherwise the column is displayed as plain rectangle using pen() and brush().
Parameters
rect Rectangle where to paint the column in paint device coordinates
sample Sample to be displayed
Note
Definition at line 653 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::drawColumns (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, int from, int to) const [protected]
Draw a histogram in Columns style()
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
from Index of the first sample to be painted
to Index of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
See also
Definition at line 461 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::drawLines (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, int from, int to) const [protected]
Draw a histogram in Lines style()
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
from Index of the first sample to be painted
to Index of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
See also
Definition at line 493 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::drawOutline (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, int from, int to) const [protected]
Draw a histogram in Outline style()
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
from Index of the first sample to be painted
to Index of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
See also
Warning
Definition at line 376 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::drawSeries (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int to) const [override], [virtual]
Draw a subset of the histogram samples
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
canvasRect Contents rectangle of the canvas
from Index of the first sample to be painted
to Index of the last sample to be painted. If to < 0 the series will be painted to its last sample.
See also
Implements QwtPlotSeriesItem.
Definition at line 334 of file qwt_plot_histogram.cpp.
QwtGraphic QwtPlotHistogram::legendIcon (int index, const QSizeF & size) const [override], [virtual]
A plain rectangle without pen using the brush()
Parameters
size Icon size
Returns
See also
Reimplemented from QwtPlotItem.
Definition at line 688 of file qwt_plot_histogram.cpp.
const QPen & QwtPlotHistogram::pen () const
Returns
See also
Definition at line 163 of file qwt_plot_histogram.cpp.
int QwtPlotHistogram::rtti () const [override], [virtual]
Returns
Reimplemented from QwtPlotItem.
Definition at line 290 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setBaseline (double value)
Set the value of the baseline. Each column representing an QwtIntervalSample is defined by its interval and the interval between baseline and the value of the sample.
The default value of the baseline is 0.0.
Parameters
See also
Definition at line 240 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setBrush (const QBrush & brush)
Assign a brush, that is used in a style() depending way.
Parameters
See also
Definition at line 174 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setPen (const QColor & color, qreal width = 0.0, Qt::PenStyle style = Qt::SolidLine)
Build and assign a pen
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.
Parameters
width Pen width
style Pen style
See also
Definition at line 137 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setPen (const QPen & pen)
Assign a pen, that is used in a style() depending way.
Parameters
See also
Definition at line 148 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setSamples (const QVector< QwtIntervalSample > & samples)
Initialize data with an array of samples.
Parameters
Definition at line 299 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setSamples (QwtSeriesData< QwtIntervalSample > * data)
Assign a series of samples
setSamples() is just a wrapper for setData() without any additional value - beside that it is easier to find for the developer.
Parameters
Warning
Definition at line 315 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setStyle (HistogramStyle style)
Set the histogram's drawing style
Parameters
See also
Definition at line 104 of file qwt_plot_histogram.cpp.
void QwtPlotHistogram::setSymbol (const QwtColumnSymbol * symbol)
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 baseline() and value. When no symbol has been defined the area is displayed as plain rectangle using pen() and brush().
See also
Note
Definition at line 208 of file qwt_plot_histogram.cpp.
QwtPlotHistogram::HistogramStyle QwtPlotHistogram::style () const
Returns
See also
Definition at line 119 of file qwt_plot_histogram.cpp.
const QwtColumnSymbol * QwtPlotHistogram::symbol () const
Returns
See also
Definition at line 224 of file qwt_plot_histogram.cpp.
Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |