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

Abstract base class for bar chart items 更多...

#include <qwt_plot_abstract_barchart.h>

类 QwtPlotAbstractBarChart 继承关系图:
QwtPlotSeriesItem QwtPlotItem QwtAbstractSeriesStore QwtPlotBarChart QwtPlotMultiBarChart

class  PrivateData
 

Public 类型

enum  LayoutPolicy { AutoAdjustSamples , ScaleSamplesToAxes , ScaleSampleToCanvas , FixedSampleSize }
 Mode how to calculate the bar width 更多...
 
- 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 成员函数

 QwtPlotAbstractBarChart (const QwtText &title)
 Constructor
 
void setLayoutPolicy (LayoutPolicy)
 Set the layout policy
 
LayoutPolicy layoutPolicy () const
 Get the layout policy
 
void setLayoutHint (double)
 Set the layout hint
 
double layoutHint () const
 Get the layout hint
 
void setSpacing (int)
 Set the spacing between bars
 
int spacing () const
 Get the spacing between bars
 
void setMargin (int)
 Set the margin around the bars
 
int margin () const
 Get the margin around the bars
 
void setBaseline (double)
 Set the baseline value
 
double baseline () const
 Get the baseline value
 
virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const override
 Calculate a hint for the canvas margin
 
- 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 drawSeries (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
 Draw a subset of the samples
 
virtual QRectF boundingRect () const override
 Get the bounding rectangle
 
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
 
virtual void attach (QwtPlot *plot)
 Attach the item to a plot
 
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
 
virtual int rtti () const
 Runtime type information
 
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 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
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const
 Return a legend icon
 

Protected 成员函数

double sampleWidth (const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
 Calculate the width for a sample in paint device coordinates
 
- 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
 
- Protected 成员函数 继承自 QwtAbstractSeriesStore
virtual void setRectOfInterest (const QRectF &)=0
 Set a the "rectangle of interest" for the stored series
 
virtual QRectF dataRect () const =0
 
virtual size_t dataSize () const =0
 

详细描述

Abstract base class for bar chart items

In opposite to almost all other plot items bar charts can't be displayed inside of their bounding rectangle and need a special API how to calculate the width of the bars and how they affect the layout of the attached plot.

成员枚举类型说明

◆ LayoutPolicy

Mode how to calculate the bar width

setLayoutPolicy(), setLayoutHint(), barWidthHint()

枚举值
AutoAdjustSamples 

The sample width is calculated by dividing the bounding rectangle by the number of samples.

The layoutHint() is used as a minimum width in paint device coordinates.

参见
boundingRectangle()
ScaleSamplesToAxes 

layoutHint() defines an interval in axis coordinates

ScaleSampleToCanvas 

The bar width is calculated by multiplying layoutHint() with the height or width of the canvas.

参见
boundingRectangle()
FixedSampleSize 

layoutHint() defines a fixed width in paint device coordinates.

构造及析构函数说明

◆ QwtPlotAbstractBarChart()

QwtPlotAbstractBarChart::QwtPlotAbstractBarChart ( const QwtText title)
explicit

Constructor

参数
[in]titleTitle of the chart

Destructor

成员函数说明

◆ baseline()

double QwtPlotAbstractBarChart::baseline ( ) const

Get the baseline value

返回
Value for the origin of the bar chart
参见
setBaseline(), QwtPlotSeriesItem::orientation()

◆ getCanvasMarginHint()

void QwtPlotAbstractBarChart::getCanvasMarginHint ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
double &  left,
double &  top,
double &  right,
double &  bottom 
) const
overridevirtual

Calculate a hint for the canvas margin

Bar charts need to reserve some space for displaying the bars for the first and the last sample. The hint is calculated from the layoutHint() depending on the layoutPolicy(). The margins are in target device coordinates ( pixels on screen ).

参数
[in]xMapMaps x-values into pixel coordinates.
[in]yMapMaps y-values into pixel coordinates.
[in]canvasRectContents rectangle of the canvas in painter coordinates
[out]leftReturns the left margin
[out]topReturns the top margin
[out]rightReturns the right margin
[out]bottomReturns the bottom margin
参见
layoutPolicy(), layoutHint(), QwtPlotItem::Margins, QwtPlot::getCanvasMarginsHint(), QwtPlot::updateCanvasMargins()

重载 QwtPlotItem .

◆ layoutHint()

double QwtPlotAbstractBarChart::layoutHint ( ) const

Get the layout hint

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

返回
Layout hint of the chart item
参见
LayoutPolicy, setLayoutHint(), layoutPolicy()

◆ layoutPolicy()

QwtPlotAbstractBarChart::LayoutPolicy QwtPlotAbstractBarChart::layoutPolicy ( ) const

Get the layout policy

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

返回
Layout policy of the chart item
参见
setLayoutPolicy(), layoutHint()

◆ margin()

int QwtPlotAbstractBarChart::margin ( ) const

Get the margin around the bars

返回
Margin between the outmost bars and the contentsRect() of the canvas.
参见
setMargin(), spacing()

◆ sampleWidth()

double QwtPlotAbstractBarChart::sampleWidth ( const QwtScaleMap map,
double  canvasSize,
double  boundingSize,
double  value 
) const
protected

Calculate the width for a sample in paint device coordinates

参数
mapScale map for the corresponding scale
canvasSizeSize of the canvas in paint device coordinates
boundingSizeBounding size of the chart in plot coordinates ( used in AutoAdjustSamples mode )
valueValue of the sample
返回
Sample width
参见
layoutPolicy(), layoutHint()

◆ setBaseline()

void QwtPlotAbstractBarChart::setBaseline ( double  value)

Set the baseline value

The baseline is the origin for the chart. Each bar is painted from the baseline in the direction of the sample value. In case of a horizontal orientation() the baseline is interpreted as x - otherwise as y - value. The default value for the baseline is 0.

参数
[in]valueValue for the baseline
参见
baseline(), QwtPlotSeriesItem::orientation()

◆ setLayoutHint()

void QwtPlotAbstractBarChart::setLayoutHint ( double  hint)

Set the layout hint

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

参数
[in]hintLayout hint
参见
LayoutPolicy, layoutPolicy(), layoutHint()

◆ setLayoutPolicy()

void QwtPlotAbstractBarChart::setLayoutPolicy ( LayoutPolicy  policy)

Set the layout policy

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

参数
[in]policyLayout policy
参见
layoutPolicy(), layoutHint()

◆ setMargin()

void QwtPlotAbstractBarChart::setMargin ( int  margin)

Set the margin around the bars

The margin is the distance between the outmost bars and the contentsRect() of the canvas. The default setting is 5 pixels.

参数
[in]marginMargin in pixels
参见
spacing(), margin()

◆ setSpacing()

void QwtPlotAbstractBarChart::setSpacing ( int  spacing)

Set the spacing between bars

The spacing is the distance between 2 samples ( bars for QwtPlotBarChart or a group of bars for QwtPlotMultiBarChart ) in paint device coordinates.

参数
[in]spacingSpacing in pixels
参见
spacing()

◆ spacing()

int QwtPlotAbstractBarChart::spacing ( ) const

Get the spacing between bars

返回
Spacing between 2 samples ( bars or groups of bars )
参见
setSpacing(), margin()

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