Qwt User's Guide
6.0.2
|
#include <qwt_plot_histogram.h>
Public Types | |
enum | HistogramStyle { Outline, Columns, Lines, UserStyle = 100 } |
Public Member Functions | |
QwtPlotHistogram (const QString &title=QString::null) | |
QwtPlotHistogram (const QwtText &title) | |
virtual | ~QwtPlotHistogram () |
double | baseline () const |
virtual QRectF | boundingRect () const |
const QBrush & | brush () const |
virtual void | drawLegendIdentifier (QPainter *, const QRectF &) const |
virtual void | drawSeries (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
const QPen & | pen () const |
virtual int | rtti () const |
void | setBaseline (double reference) |
void | setBrush (const QBrush &) |
void | setPen (const QPen &) |
void | setSamples (const QVector< QwtIntervalSample > &) |
void | setStyle (HistogramStyle style) |
void | setSymbol (const QwtColumnSymbol *) |
HistogramStyle | style () const |
const QwtColumnSymbol * | symbol () const |
![]() | |
QwtPlotSeriesItem (const QString &title=QString::null) | |
QwtPlotSeriesItem (const QwtText &title) | |
virtual | ~QwtPlotSeriesItem () |
QwtSeriesData < QwtIntervalSample > * | data () |
const QwtSeriesData < QwtIntervalSample > * | data () const |
size_t | dataSize () const |
QwtIntervalSample | sample (int index) const |
void | setData (QwtSeriesData< QwtIntervalSample > *) |
virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) |
![]() | |
QwtPlotAbstractSeriesItem (const QString &title=QString::null) | |
QwtPlotAbstractSeriesItem (const QwtText &title) | |
virtual | ~QwtPlotAbstractSeriesItem () |
virtual void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const |
Qt::Orientation | orientation () const |
void | setOrientation (Qt::Orientation) |
![]() | |
QwtPlotItem (const QwtText &title=QwtText()) | |
virtual | ~QwtPlotItem () |
void | attach (QwtPlot *plot) |
void | detach () |
void | hide () |
bool | isVisible () const |
virtual void | itemChanged () |
virtual QWidget * | legendItem () const |
QRectF | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
QwtPlot * | plot () const |
QRectF | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
void | setAxes (int xAxis, int yAxis) |
void | setItemAttribute (ItemAttribute, bool on=true) |
void | setRenderHint (RenderHint, bool on=true) |
void | setTitle (const QString &title) |
void | setTitle (const QwtText &title) |
virtual void | setVisible (bool) |
void | setXAxis (int axis) |
void | setYAxis (int axis) |
void | setZ (double z) |
void | show () |
bool | testItemAttribute (ItemAttribute) const |
bool | testRenderHint (RenderHint) const |
const QwtText & | title () const |
virtual void | updateLegend (QwtLegend *) const |
int | xAxis () const |
int | yAxis () const |
double | z () const |
![]() | |
QwtLegendItemManager () | |
virtual | ~QwtLegendItemManager () |
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 | drawLines (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 |
Additional Inherited Members | |
![]() | |
QwtSeriesData < QwtIntervalSample > * | d_series |
QwtPlotHistogram represents a series of samples, where an interval is associated with a value ( ).
The representation depends on the style() and an optional symbol() that is displayed for each interval.
Histogram styles. The default style is QwtPlotHistogram::Columns.
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. |
|
explicit |
Constructor
title | Title of the histogram. |
|
explicit |
Constructor
title | Title of the histogram. |
double QwtPlotHistogram::baseline | ( | ) | const |
|
virtual |
Reimplemented from QwtPlotSeriesItem< QwtIntervalSample >.
const QBrush & QwtPlotHistogram::brush | ( | ) | const |
|
protectedvirtual |
Calculate the area that is covered by a sample
sample | Sample |
xMap | Maps x-values into pixel coordinates. |
yMap | Maps y-values into pixel coordinates. |
|
protectedvirtual |
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().
painter | Painter |
rect | Rectangle where to paint the column in paint device coordinates |
sample | Sample to be displayed |
|
protected |
Draw a histogram in Columns style()
painter | Painter |
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. |
|
virtual |
Draw a plain rectangle without pen using the brush() as identifier
painter | Painter |
rect | Bounding rectangle for the identifier |
Reimplemented from QwtLegendItemManager.
|
protected |
Draw a histogram in Lines style()
painter | Painter |
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. |
|
protected |
Draw a histogram in Outline style()
painter | Painter |
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. |
|
virtual |
Draw a subset of the histogram samples
painter | Painter |
xMap | Maps x-values into pixel coordinates. |
yMap | Maps y-values into pixel coordinates. |
canvasRect | Contents rect 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. |
Implements QwtPlotAbstractSeriesItem.
const QPen & QwtPlotHistogram::pen | ( | ) | const |
|
virtual |
Reimplemented from QwtPlotItem.
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.
value | Value of the baseline |
void QwtPlotHistogram::setBrush | ( | const QBrush & | brush | ) |
void QwtPlotHistogram::setPen | ( | const QPen & | pen | ) |
void QwtPlotHistogram::setSamples | ( | const QVector< QwtIntervalSample > & | samples | ) |
Initialize data with an array of samples.
samples | Vector of points |
void QwtPlotHistogram::setStyle | ( | HistogramStyle | style | ) |
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().
QwtPlotHistogram::HistogramStyle QwtPlotHistogram::style | ( | ) | const |
Return the current style
const QwtColumnSymbol * QwtPlotHistogram::symbol | ( | ) | const |