A QwtPlotItem that renders a histogram as vertical bars in a QwtPlot.
More...
#include <QmitkHistogram.h>
|
| | QmitkHistogram (const QString &title=QString()) |
| | Construct a histogram with a plain text title. More...
|
| |
| | QmitkHistogram (const QwtText &title) |
| | Construct a histogram with a formatted QwtText title. More...
|
| |
| | ~QmitkHistogram () override |
| | Destructor. More...
|
| |
| void | setData (const QwtIntervalSeriesData &data) |
| | Set the interval series data for the histogram. More...
|
| |
| const QwtIntervalSeriesData & | data () const |
| | Get the current interval series data. More...
|
| |
| void | setColor (const QColor &color) |
| | Set the fill color for the histogram bars. More...
|
| |
| QColor | color () const |
| | Get the current bar color. More...
|
| |
| QRectF | boundingRect () const override |
| | Calculate the bounding rectangle of the histogram data. More...
|
| |
| void | draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override |
| | Draw the histogram bars onto the given painter. More...
|
| |
| void | setBaseline (double reference) |
| | Set the baseline reference value for the histogram. More...
|
| |
| double | baseline () const |
| | Get the current baseline reference value. More...
|
| |
|
| virtual void | drawBar (QPainter *painter, Qt::Orientation o, const QRect &rect) const |
| | Draw a single histogram bar with 3D shading. More...
|
| |
A QwtPlotItem that renders a histogram as vertical bars in a QwtPlot.
Each bar corresponds to an interval sample. Bars are drawn with a 3D shading effect using lighter/darker pen colors. The baseline reference value can be adjusted.
- See also
- QmitkPlotWidget, QmitkPlotDialog
Definition at line 31 of file QmitkHistogram.h.
◆ QmitkHistogram() [1/2]
| QmitkHistogram::QmitkHistogram |
( |
const QString & |
title = QString() | ) |
|
|
explicit |
Construct a histogram with a plain text title.
- Parameters
-
| [in] | title | The title string for the histogram item. |
◆ QmitkHistogram() [2/2]
| QmitkHistogram::QmitkHistogram |
( |
const QwtText & |
title | ) |
|
|
explicit |
Construct a histogram with a formatted QwtText title.
- Parameters
-
| [in] | title | The QwtText title. |
◆ ~QmitkHistogram()
| QmitkHistogram::~QmitkHistogram |
( |
| ) |
|
|
override |
◆ baseline()
| double QmitkHistogram::baseline |
( |
| ) |
const |
Get the current baseline reference value.
- Returns
- The baseline value.
◆ boundingRect()
| QRectF QmitkHistogram::boundingRect |
( |
| ) |
const |
|
override |
Calculate the bounding rectangle of the histogram data.
- Returns
- The bounding rectangle including the baseline.
◆ color()
| QColor QmitkHistogram::color |
( |
| ) |
const |
Get the current bar color.
- Returns
- The color.
◆ data()
| const QwtIntervalSeriesData& QmitkHistogram::data |
( |
| ) |
const |
Get the current interval series data.
- Returns
- Const reference to the data.
◆ draw()
| void QmitkHistogram::draw |
( |
QPainter * |
painter, |
|
|
const QwtScaleMap & |
xMap, |
|
|
const QwtScaleMap & |
yMap, |
|
|
const QRectF & |
canvasRect |
|
) |
| const |
|
override |
Draw the histogram bars onto the given painter.
- Parameters
-
| [in] | painter | The QPainter to draw with. |
| [in] | xMap | Scale map for the x axis. |
| [in] | yMap | Scale map for the y axis. |
| [in] | canvasRect | The canvas rectangle (unused). |
◆ drawBar()
| virtual void QmitkHistogram::drawBar |
( |
QPainter * |
painter, |
|
|
Qt::Orientation |
o, |
|
|
const QRect & |
rect |
|
) |
| const |
|
protectedvirtual |
Draw a single histogram bar with 3D shading.
- Parameters
-
| [in] | painter | The QPainter. |
| [in] | o | The bar orientation. |
| [in] | rect | The rectangle defining the bar area. |
◆ setBaseline()
| void QmitkHistogram::setBaseline |
( |
double |
reference | ) |
|
Set the baseline reference value for the histogram.
- Parameters
-
| [in] | reference | The y value of the baseline. |
◆ setColor()
| void QmitkHistogram::setColor |
( |
const QColor & |
color | ) |
|
Set the fill color for the histogram bars.
- Parameters
-
◆ setData()
| void QmitkHistogram::setData |
( |
const QwtIntervalSeriesData & |
data | ) |
|
Set the interval series data for the histogram.
- Parameters
-
| [in] | data | The interval series data containing bin intervals and values. |
The documentation for this class was generated from the following file: