QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtPlotBoxChart Class Reference

Plot item for box-and-whisker (boxplot) visualization. More...

#include <qwt_plot_boxchart.h>

Inheritance diagram for QwtPlotBoxChart:
QwtPlotSeriesItem QwtSeriesStore< QwtBoxSample > QwtPlotItem QwtAbstractSeriesStore QwtAbstractSeriesStore

Classes

class  PrivateData
 

Public Types

enum  BoxStyle { NoBox , Rect , Diamond , Notch }
 Box body display style. More...
 
enum  WhiskerStyle { NoWhiskers , StandardWhisker , MinMaxLine }
 Whisker display style. More...
 
enum  PaintAttribute { ClipBoxes = 0x01 , ClipOutliers = 0x02 , ImageBuffer = 0x04 }
 Paint attributes for performance optimization. More...
 
- Public Types inherited from QwtPlotItem
enum  RttiValues {
  Rtti_PlotItem = 0 , Rtti_PlotGrid , Rtti_PlotScale , Rtti_PlotLegend ,
  Rtti_PlotMarker , Rtti_PlotCurve , Rtti_PlotSpectroCurve , Rtti_PlotIntervalCurve ,
  Rtti_PlotHistogram , Rtti_PlotSpectrogram , Rtti_PlotGraphic , Rtti_PlotTradingCurve ,
  Rtti_PlotBarChart , Rtti_PlotMultiBarChart , Rtti_PlotShape , Rtti_PlotTextLabel ,
  Rtti_PlotZone , Rtti_PlotVectorField , Rtti_PlotArrowMarker , Rtti_PlotBoxChart ,
  Rtti_PlotUserItem = 1000
}
 Runtime type information. More...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 }
 Plot Item Attributes. More...
 
enum  ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 }
 Plot Item Interests. More...
 
enum  RenderHint { RenderAntialiased = 0x1 }
 Render hints. More...
 

Public Member Functions

 QwtPlotBoxChart (const QString &title=QString())
 Constructor.
 
 QwtPlotBoxChart (const QwtText &title)
 Constructor with QwtText title.
 
 ~QwtPlotBoxChart () override
 Destructor.
 
virtual int rtti () const override
 Get the runtime type information.
 
void attach (QwtPlot *plot) override
 Attach the box chart to a plot.
 
void setPaintAttribute (PaintAttribute, bool on=true)
 Set a paint attribute.
 
bool testPaintAttribute (PaintAttribute) const
 Test if a paint attribute is enabled.
 
void setSamples (const QVector< QwtBoxSample > &)
 Set box samples from a vector.
 
void setSamples (QwtSeriesData< QwtBoxSample > *)
 Set box samples from series data.
 
void setOutliers (const QVector< QwtBoxOutlierSample > &)
 Set outlier samples from a vector.
 
void setOutliers (QwtSeriesData< QwtBoxOutlierSample > *)
 Set outlier samples from series data.
 
const QwtSeriesData< QwtBoxOutlierSample > * outlierData () const
 Get the outlier data.
 
void setBoxStyle (BoxStyle)
 Set the box style.
 
BoxStyle boxStyle () const
 Get the box style.
 
void setWhiskerStyle (WhiskerStyle)
 Set the whisker style.
 
WhiskerStyle whiskerStyle () const
 Get the whisker style.
 
void setOrientation (Qt::Orientation)
 Set the orientation.
 
Qt::Orientation orientation () const
 Get the orientation.
 
void setBoxExtent (double extent)
 Set the box extent (width in scale coordinates)
 
double boxExtent () const
 Get the box extent.
 
void setMinBoxWidth (double pixels)
 Set the minimum box width in pixels.
 
double minBoxWidth () const
 Get the minimum box width.
 
void setMaxBoxWidth (double pixels)
 Set the maximum box width in pixels.
 
double maxBoxWidth () const
 Get the maximum box width.
 
void setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
 Set the pen for box outline and whiskers.
 
void setPen (const QPen &)
 Set the pen for box outline and whiskers.
 
const QPen & pen () const
 Get the pen for box outline and whiskers.
 
void setBrush (const QBrush &)
 Set the brush for box body fill.
 
const QBrush & brush () const
 Get the brush for box body fill.
 
void setMedianPen (const QPen &)
 Set the pen for median line.
 
QPen medianPen () const
 Get the pen for median line.
 
void setOutlierSymbol (const QwtSymbol *)
 Set the symbol for outliers.
 
const QwtSymboloutlierSymbol () const
 Get the symbol for outliers.
 
void setMeanSymbol (const QwtSymbol *)
 Set the symbol for mean marker.
 
const QwtSymbolmeanSymbol () const
 Get the symbol for mean marker.
 
void setMedianVisible (bool)
 Set whether the median line is visible.
 
bool isMedianVisible () const
 Check if the median line is visible.
 
void setMeanVisible (bool)
 Set whether the mean marker is visible.
 
bool isMeanVisible () const
 Check if the mean marker is visible.
 
void setOutlierJitter (double jitterWidth)
 Set the outlier jitter width.
 
double outlierJitter () const
 Get the outlier jitter width.
 
virtual void drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override
 Draw the series.
 
virtual QRectF boundingRect () const override
 Get the bounding rectangle.
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const override
 Get the legend icon.
 
- Public Member Functions inherited from QwtPlotSeriesItem
 QwtPlotSeriesItem (const QString &title=QString())
 
 QwtPlotSeriesItem (const QwtText &title)
 Constructor.
 
void setOrientation (Qt::Orientation)
 Set the orientation of the item.
 
Qt::Orientation orientation () const
 Get the orientation of the plot item.
 
virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 Draw the complete series.
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override
 Update the scale divisions.
 
- Public Member Functions inherited from QwtPlotItem
 QwtPlotItem ()
 Default constructor.
 
 QwtPlotItem (const QString &title)
 Constructor with title as QString.
 
 QwtPlotItem (const QwtText &title)
 Constructor with title as QwtText.
 
virtual ~QwtPlotItem ()
 Destructor.
 
void detach ()
 Detach the item from the plot.
 
QwtPlotplot () const
 Get the plot the item is attached to.
 
void setTitle (const QString &title)
 Set the title using a QString.
 
void setTitle (const QwtText &title)
 Set the title using a QwtText.
 
const QwtTexttitle () const
 Get the title.
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute.
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute.
 
void setItemInterest (ItemInterest, bool on=true)
 Set an item interest.
 
bool testItemInterest (ItemInterest) const
 Test an item interest.
 
void setRenderHint (RenderHint, bool on=true)
 Set a render hint.
 
bool testRenderHint (RenderHint) const
 Test a render hint.
 
void setRenderThreadCount (uint numThreads)
 Set the number of render threads.
 
uint renderThreadCount () const
 Get the number of render threads.
 
void setLegendIconSize (const QSize &)
 Set the legend icon size.
 
QSize legendIconSize () const
 Get the legend icon size.
 
double z () const
 Get the z-value.
 
void setZ (double z)
 Set the z-value.
 
void show ()
 Show the item.
 
void hide ()
 Hide the item.
 
virtual void setVisible (bool)
 Set the visibility.
 
bool isVisible () const
 Check if the item is visible.
 
void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)
 Set both axes.
 
void setXAxis (QwtAxisId)
 Set the x-axis.
 
QwtAxisId xAxis () const
 Get the x-axis.
 
void setYAxis (QwtAxisId)
 Set the y-axis.
 
QwtAxisId yAxis () const
 Get the y-axis.
 
virtual void itemChanged ()
 Notify the plot that the item has changed.
 
virtual void legendChanged ()
 Notify the item that the legend has changed.
 
virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
 Get margin hints for the canvas.
 
virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)
 Update the item with changes of the legend.
 
QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the scale rectangle.
 
QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the paint rectangle.
 
virtual QList< QwtLegendDatalegendData () const
 Return legend data.
 
- Public Member Functions inherited from QwtSeriesStore< QwtBoxSample >
void setData (QwtSeriesData< QwtBoxSample > *series)
 
QwtSeriesData< QwtBoxSample > * data ()
 
const QwtSeriesData< QwtBoxSample > * data () const
 
QwtBoxSample sample (size_t index) const
 
virtual size_t dataSize () const override
 
virtual QRectF dataRect () const override
 
virtual void setRectOfInterest (const QRectF &rect) override
 Set a the "rectangle of interest" for the stored series.
 
QwtSeriesData< QwtBoxSample > * swapData (QwtSeriesData< QwtBoxSample > *series)
 

Protected Member Functions

void init ()
 Initialize.
 
virtual double scaledBoxWidth (const QwtScaleMap &posMap, const QwtScaleMap &valueMap, const QRectF &canvasRect) const
 Calculate scaled box width in pixels.
 
virtual void drawBox (QPainter *, const QwtBoxSample &, Qt::Orientation, double boxWidth, double posPixel, const QwtScaleMap &valueMap) const
 Draw a single box.
 
virtual void drawWhiskers (QPainter *, const QwtBoxSample &, Qt::Orientation, double boxWidth, double posPixel, const QwtScaleMap &valueMap) const
 Draw whiskers for a single box.
 
virtual void drawMedian (QPainter *, const QwtBoxSample &, Qt::Orientation, double boxWidth, double posPixel, const QwtScaleMap &valueMap) const
 Draw median line for a single box.
 
virtual void drawOutliers (QPainter *, const QwtScaleMap &posMap, const QwtScaleMap &valueMap, const QRectF &canvasRect, int from, int to) const
 Draw outliers for boxes in range.
 
virtual void drawOutlierSymbol (QPainter *, double posPixel, double valuePixel, const QwtSymbol &symbol) const
 Draw a single outlier symbol.
 
- Protected Member Functions inherited from QwtPlotSeriesItem
virtual void dataChanged () override
 dataChanged() indicates, that the series has been changed.
 
- Protected Member Functions inherited from QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon.
 

Detailed Description

Plot item for box-and-whisker (boxplot) visualization.

QwtPlotBoxChart displays statistical distributions using the boxplot format:

Supports multiple box styles (Rectangle, Diamond, Notch), horizontal/vertical orientation, and extensive customization.

Member Enumeration Documentation

◆ BoxStyle

Box body display style.

Enumerator
NoBox 

No box body, only whiskers and outliers.

Rect 

Traditional rectangular box (Q1-Q3)

Diamond 

Diamond shape connecting extremes.

Notch 

Rectangle with notch indentation at median.

◆ PaintAttribute

Paint attributes for performance optimization.

Enumerator
ClipBoxes 

Clip boxes before painting (performance for zoomed views)

ClipOutliers 

Clip outlier symbols before painting.

ImageBuffer 

Use image buffer for rendering (optimization for many boxes)

◆ WhiskerStyle

Whisker display style.

Enumerator
NoWhiskers 

No whisker lines drawn.

StandardWhisker 

Traditional T-bar whiskers with horizontal caps (default)

MinMaxLine 

Simple line from whiskerLower to whiskerUpper.

Constructor & Destructor Documentation

◆ QwtPlotBoxChart() [1/2]

QwtPlotBoxChart::QwtPlotBoxChart ( const QString &  title = QString())
explicit

Constructor.

Parameters
[in]titleTitle of the chart

◆ QwtPlotBoxChart() [2/2]

QwtPlotBoxChart::QwtPlotBoxChart ( const QwtText title)
explicit

Constructor with QwtText title.

Constructor.

Parameters
[in]titleTitle of the chart

Member Function Documentation

◆ attach()

void QwtPlotBoxChart::attach ( QwtPlot plot)
overridevirtual

Attach the box chart to a plot.

If the pen has not been explicitly set by the user, the box chart automatically receives a color from the plot's color cycle. The brush is set to a semi-transparent version of the same color.

Parameters
plotPlot to attach to (nullptr to detach)

Reimplemented from QwtPlotItem.

◆ boundingRect()

QRectF QwtPlotBoxChart::boundingRect ( ) const
overridevirtual

Get the bounding rectangle.

Returns
Bounding rectangle of all samples

Reimplemented from QwtPlotSeriesItem.

◆ boxExtent()

double QwtPlotBoxChart::boxExtent ( ) const

Get the box extent.

Returns
Current box extent

◆ boxStyle()

QwtPlotBoxChart::BoxStyle QwtPlotBoxChart::boxStyle ( ) const

Get the box style.

Returns
Current box style

◆ brush()

const QBrush & QwtPlotBoxChart::brush ( ) const

Get the brush for box body fill.

Returns
Current brush

◆ drawSeries()

void QwtPlotBoxChart::drawSeries ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
int  from,
int  to 
) const
overridevirtual

Draw the series.

Parameters
[in]painterPainter
[in]xMapX-axis scale map
[in]yMapY-axis scale map
[in]canvasRectCanvas rectangle
[in]fromStarting index
[in]toEnding index

Implements QwtPlotSeriesItem.

◆ isMeanVisible()

bool QwtPlotBoxChart::isMeanVisible ( ) const

Check if the mean marker is visible.

Returns
True if visible

◆ isMedianVisible()

bool QwtPlotBoxChart::isMedianVisible ( ) const

Check if the median line is visible.

Returns
True if visible

◆ legendIcon()

QwtGraphic QwtPlotBoxChart::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual

Get the legend icon.

Parameters
[in]indexLegend entry index
[in]sizeIcon size
Returns
Legend icon graphic

Reimplemented from QwtPlotItem.

◆ maxBoxWidth()

double QwtPlotBoxChart::maxBoxWidth ( ) const

Get the maximum box width.

Returns
Maximum box width in pixels (negative = unlimited)

◆ meanSymbol()

const QwtSymbol * QwtPlotBoxChart::meanSymbol ( ) const

Get the symbol for mean marker.

Returns
Current mean symbol

◆ medianPen()

QPen QwtPlotBoxChart::medianPen ( ) const

Get the pen for median line.

Returns
Current median pen

◆ minBoxWidth()

double QwtPlotBoxChart::minBoxWidth ( ) const

Get the minimum box width.

Returns
Minimum box width in pixels

◆ orientation()

Qt::Orientation QwtPlotBoxChart::orientation ( ) const

Get the orientation.

Returns
Current orientation

◆ outlierData()

const QwtSeriesData< QwtBoxOutlierSample > * QwtPlotBoxChart::outlierData ( ) const

Get the outlier data.

Returns
Current outlier data

◆ outlierJitter()

double QwtPlotBoxChart::outlierJitter ( ) const

Get the outlier jitter width.

Returns
Jitter width for overlapping outliers

◆ outlierSymbol()

const QwtSymbol * QwtPlotBoxChart::outlierSymbol ( ) const

Get the symbol for outliers.

Returns
Current outlier symbol

◆ pen()

const QPen & QwtPlotBoxChart::pen ( ) const

Get the pen for box outline and whiskers.

Returns
Current pen

◆ rtti()

int QwtPlotBoxChart::rtti ( ) const
overridevirtual

Get the runtime type information.

Returns
Rtti_PlotBoxChart

Reimplemented from QwtPlotItem.

◆ setBoxExtent()

void QwtPlotBoxChart::setBoxExtent ( double  extent)

Set the box extent (width in scale coordinates)

Parameters
[in]extentBox extent to set

◆ setBoxStyle()

void QwtPlotBoxChart::setBoxStyle ( BoxStyle  style)

Set the box style.

Parameters
[in]styleBox style to set

◆ setBrush()

void QwtPlotBoxChart::setBrush ( const QBrush &  brush)

Set the brush for box body fill.

Parameters
[in]brushBrush to set

◆ setMaxBoxWidth()

void QwtPlotBoxChart::setMaxBoxWidth ( double  pixels)

Set the maximum box width in pixels.

Parameters
[in]pixelsMaximum width to set (negative = unlimited)

◆ setMeanSymbol()

void QwtPlotBoxChart::setMeanSymbol ( const QwtSymbol symbol)

Set the symbol for mean marker.

Parameters
[in]symbolSymbol to set

◆ setMeanVisible()

void QwtPlotBoxChart::setMeanVisible ( bool  visible)

Set whether the mean marker is visible.

Parameters
[in]visibleTrue to show, false to hide

◆ setMedianPen()

void QwtPlotBoxChart::setMedianPen ( const QPen &  pen)

Set the pen for median line.

Parameters
[in]penPen to set

◆ setMedianVisible()

void QwtPlotBoxChart::setMedianVisible ( bool  visible)

Set whether the median line is visible.

Parameters
[in]visibleTrue to show, false to hide

◆ setMinBoxWidth()

void QwtPlotBoxChart::setMinBoxWidth ( double  pixels)

Set the minimum box width in pixels.

Parameters
[in]pixelsMinimum width to set

◆ setOrientation()

void QwtPlotBoxChart::setOrientation ( Qt::Orientation  orient)

Set the orientation.

Vertical orientation means x-position, horizontal means y-position.

Parameters
[in]orientOrientation to set

◆ setOutlierJitter()

void QwtPlotBoxChart::setOutlierJitter ( double  jitterWidth)

Set the outlier jitter width.

Parameters
[in]jitterWidthJitter width for overlapping outliers

◆ setOutliers() [1/2]

void QwtPlotBoxChart::setOutliers ( const QVector< QwtBoxOutlierSample > &  samples)

Set outlier samples from a vector.

Parameters
[in]samplesVector of outlier samples

◆ setOutliers() [2/2]

void QwtPlotBoxChart::setOutliers ( QwtSeriesData< QwtBoxOutlierSample > *  data)

Set outlier samples from series data.

Parameters
[in]dataSeries data to set

◆ setOutlierSymbol()

void QwtPlotBoxChart::setOutlierSymbol ( const QwtSymbol symbol)

Set the symbol for outliers.

Parameters
[in]symbolSymbol to set

◆ setPaintAttribute()

void QwtPlotBoxChart::setPaintAttribute ( PaintAttribute  attr,
bool  on = true 
)

Set a paint attribute.

Parameters
[in]attrPaint attribute to set
[in]onTrue to enable, false to disable

◆ setPen() [1/2]

void QwtPlotBoxChart::setPen ( const QColor &  color,
qreal  width = 0.0,
Qt::PenStyle  style = Qt::SolidLine 
)

Set the pen for box outline and whiskers.

Parameters
[in]colorPen color
[in]widthPen width
[in]stylePen style

◆ setPen() [2/2]

void QwtPlotBoxChart::setPen ( const QPen &  pen)

Set the pen for box outline and whiskers.

Parameters
[in]penPen to set

◆ setSamples() [1/2]

void QwtPlotBoxChart::setSamples ( const QVector< QwtBoxSample > &  samples)

Set box samples from a vector.

Parameters
[in]samplesVector of box samples

◆ setSamples() [2/2]

void QwtPlotBoxChart::setSamples ( QwtSeriesData< QwtBoxSample > *  data)

Set box samples from series data.

Parameters
[in]dataSeries data to set

◆ setWhiskerStyle()

void QwtPlotBoxChart::setWhiskerStyle ( WhiskerStyle  style)

Set the whisker style.

Parameters
[in]styleWhisker style to set

◆ testPaintAttribute()

bool QwtPlotBoxChart::testPaintAttribute ( PaintAttribute  attr) const

Test if a paint attribute is enabled.

Parameters
[in]attrPaint attribute to test
Returns
True if the attribute is enabled

◆ whiskerStyle()

QwtPlotBoxChart::WhiskerStyle QwtPlotBoxChart::whiskerStyle ( ) const

Get the whisker style.

Returns
Current whisker style

The documentation for this class was generated from the following files: