QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtPlotBoxChart类 参考

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

#include <qwt_plot_boxchart.h>

类 QwtPlotBoxChart 继承关系图:
QwtPlotSeriesItem QwtSeriesStore< QwtBoxSample > QwtPlotItem QwtAbstractSeriesStore QwtAbstractSeriesStore

class  PrivateData
 

Public 类型

enum  BoxStyle { NoBox , Rect , Diamond , Notch }
 Box body display style 更多...
 
enum  WhiskerStyle { NoWhiskers , StandardWhisker , MinMaxLine }
 Whisker display style 更多...
 
enum  PaintAttribute { ClipBoxes = 0x01 , ClipOutliers = 0x02 , ImageBuffer = 0x04 }
 Paint attributes for performance optimization 更多...
 
- Public 类型 继承自 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 更多...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 }
 Plot Item Attributes 更多...
 
enum  ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 }
 Plot Item Interests 更多...
 
enum  RenderHint { RenderAntialiased = 0x1 }
 Render hints 更多...
 

Public 成员函数

 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 成员函数 继承自 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 成员函数 继承自 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 成员函数 继承自 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 成员函数

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 成员函数 继承自 QwtPlotSeriesItem
virtual void dataChanged () override
 dataChanged() indicates, that the series has been changed.
 
- Protected 成员函数 继承自 QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon
 

详细描述

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.

成员枚举类型说明

◆ BoxStyle

Box body display style

枚举值
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

枚举值
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

枚举值
NoWhiskers 

No whisker lines drawn

StandardWhisker 

Traditional T-bar whiskers with horizontal caps (default)

MinMaxLine 

Simple line from whiskerLower to whiskerUpper

构造及析构函数说明

◆ QwtPlotBoxChart() [1/2]

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

Constructor

参数
[in]titleTitle of the chart

◆ QwtPlotBoxChart() [2/2]

QwtPlotBoxChart::QwtPlotBoxChart ( const QwtText title)
explicit

Constructor with QwtText title

Constructor

参数
[in]titleTitle of the chart

成员函数说明

◆ 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.

参数
plotPlot to attach to (nullptr to detach)

重载 QwtPlotItem .

◆ boundingRect()

QRectF QwtPlotBoxChart::boundingRect ( ) const
overridevirtual

Get the bounding rectangle

返回
Bounding rectangle of all samples

重载 QwtPlotSeriesItem .

◆ boxExtent()

double QwtPlotBoxChart::boxExtent ( ) const

Get the box extent

返回
Current box extent

◆ boxStyle()

QwtPlotBoxChart::BoxStyle QwtPlotBoxChart::boxStyle ( ) const

Get the box style

返回
Current box style

◆ brush()

const QBrush & QwtPlotBoxChart::brush ( ) const

Get the brush for box body fill

返回
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

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

实现了 QwtPlotSeriesItem.

◆ isMeanVisible()

bool QwtPlotBoxChart::isMeanVisible ( ) const

Check if the mean marker is visible

返回
True if visible

◆ isMedianVisible()

bool QwtPlotBoxChart::isMedianVisible ( ) const

Check if the median line is visible

返回
True if visible

◆ legendIcon()

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

Get the legend icon

参数
[in]indexLegend entry index
[in]sizeIcon size
返回
Legend icon graphic

重载 QwtPlotItem .

◆ maxBoxWidth()

double QwtPlotBoxChart::maxBoxWidth ( ) const

Get the maximum box width

返回
Maximum box width in pixels (negative = unlimited)

◆ meanSymbol()

const QwtSymbol * QwtPlotBoxChart::meanSymbol ( ) const

Get the symbol for mean marker

返回
Current mean symbol

◆ medianPen()

QPen QwtPlotBoxChart::medianPen ( ) const

Get the pen for median line

返回
Current median pen

◆ minBoxWidth()

double QwtPlotBoxChart::minBoxWidth ( ) const

Get the minimum box width

返回
Minimum box width in pixels

◆ orientation()

Qt::Orientation QwtPlotBoxChart::orientation ( ) const

Get the orientation

返回
Current orientation

◆ outlierData()

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

Get the outlier data

返回
Current outlier data

◆ outlierJitter()

double QwtPlotBoxChart::outlierJitter ( ) const

Get the outlier jitter width

返回
Jitter width for overlapping outliers

◆ outlierSymbol()

const QwtSymbol * QwtPlotBoxChart::outlierSymbol ( ) const

Get the symbol for outliers

返回
Current outlier symbol

◆ pen()

const QPen & QwtPlotBoxChart::pen ( ) const

Get the pen for box outline and whiskers

返回
Current pen

◆ rtti()

int QwtPlotBoxChart::rtti ( ) const
overridevirtual

Get the runtime type information

返回
Rtti_PlotBoxChart

重载 QwtPlotItem .

◆ setBoxExtent()

void QwtPlotBoxChart::setBoxExtent ( double  extent)

Set the box extent (width in scale coordinates)

参数
[in]extentBox extent to set

◆ setBoxStyle()

void QwtPlotBoxChart::setBoxStyle ( BoxStyle  style)

Set the box style

参数
[in]styleBox style to set

◆ setBrush()

void QwtPlotBoxChart::setBrush ( const QBrush &  brush)

Set the brush for box body fill

参数
[in]brushBrush to set

◆ setMaxBoxWidth()

void QwtPlotBoxChart::setMaxBoxWidth ( double  pixels)

Set the maximum box width in pixels

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

◆ setMeanSymbol()

void QwtPlotBoxChart::setMeanSymbol ( const QwtSymbol symbol)

Set the symbol for mean marker

参数
[in]symbolSymbol to set

◆ setMeanVisible()

void QwtPlotBoxChart::setMeanVisible ( bool  visible)

Set whether the mean marker is visible

参数
[in]visibleTrue to show, false to hide

◆ setMedianPen()

void QwtPlotBoxChart::setMedianPen ( const QPen &  pen)

Set the pen for median line

参数
[in]penPen to set

◆ setMedianVisible()

void QwtPlotBoxChart::setMedianVisible ( bool  visible)

Set whether the median line is visible

参数
[in]visibleTrue to show, false to hide

◆ setMinBoxWidth()

void QwtPlotBoxChart::setMinBoxWidth ( double  pixels)

Set the minimum box width in pixels

参数
[in]pixelsMinimum width to set

◆ setOrientation()

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

Set the orientation

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

参数
[in]orientOrientation to set

◆ setOutlierJitter()

void QwtPlotBoxChart::setOutlierJitter ( double  jitterWidth)

Set the outlier jitter width

参数
[in]jitterWidthJitter width for overlapping outliers

◆ setOutliers() [1/2]

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

Set outlier samples from a vector

参数
[in]samplesVector of outlier samples

◆ setOutliers() [2/2]

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

Set outlier samples from series data

参数
[in]dataSeries data to set

◆ setOutlierSymbol()

void QwtPlotBoxChart::setOutlierSymbol ( const QwtSymbol symbol)

Set the symbol for outliers

参数
[in]symbolSymbol to set

◆ setPaintAttribute()

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

Set a paint attribute

参数
[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

参数
[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

参数
[in]penPen to set

◆ setSamples() [1/2]

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

Set box samples from a vector

参数
[in]samplesVector of box samples

◆ setSamples() [2/2]

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

Set box samples from series data

参数
[in]dataSeries data to set

◆ setWhiskerStyle()

void QwtPlotBoxChart::setWhiskerStyle ( WhiskerStyle  style)

Set the whisker style

参数
[in]styleWhisker style to set

◆ testPaintAttribute()

bool QwtPlotBoxChart::testPaintAttribute ( PaintAttribute  attr) const

Test if a paint attribute is enabled

参数
[in]attrPaint attribute to test
返回
True if the attribute is enabled

◆ whiskerStyle()

QwtPlotBoxChart::WhiskerStyle QwtPlotBoxChart::whiskerStyle ( ) const

Get the whisker style

返回
Current whisker style

该类的文档由以下文件生成: