|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
QwtPlotMultiBarChart 显示一系列由每组值组成的样本 更多...
#include <qwt_plot_multi_barchart.h>
类 | |
| class | PrivateData |
Public 类型 | |
| enum | ChartStyle { Grouped , Stacked } |
| 图表样式 更多... | |
Public 类型 继承自 QwtPlotAbstractBarChart | |
| 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 } |
| 运行时类型信息 更多... | |
| enum | ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 } |
| 绘图项属性 更多... | |
| enum | ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 } |
| 绘图项关注的事件类型 更多... | |
| enum | RenderHint { RenderAntialiased = 0x1 } |
| 渲染提示 更多... | |
Public 成员函数 | |
| QwtPlotMultiBarChart (const QString &title=QString()) | |
| Constructor | |
| QwtPlotMultiBarChart (const QwtText &title) | |
| Constructor with title | |
| virtual | ~QwtPlotMultiBarChart () |
| Destructor | |
| virtual int | rtti () const override |
| Get the runtime type information | |
| void | setBarTitles (const QList< QwtText > &) |
| Set the bar titles | |
| QList< QwtText > | barTitles () const |
| Get the bar titles | |
| void | setSamples (const QVector< QwtSetSample > &) |
| Set samples from a vector of QwtSetSample | |
| void | setSamples (const QVector< QVector< double > > &) |
| Set samples from a vector of vectors | |
| void | setSamples (QwtSeriesData< QwtSetSample > *) |
| Set samples from a series data | |
| void | setStyle (ChartStyle style) |
| Set the chart style | |
| ChartStyle | style () const |
| Get the chart style | |
| void | setSymbol (int valueIndex, QwtColumnSymbol *) |
| Set the symbol for a specific value index | |
| const QwtColumnSymbol * | symbol (int valueIndex) const |
| Get the symbol for a specific value index | |
| void | resetSymbolMap () |
| Reset the symbol map | |
| 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 QList< QwtLegendData > | legendData () const override |
| Get the legend data | |
| virtual QwtGraphic | legendIcon (int index, const QSizeF &) const override |
| Get the legend icon | |
Public 成员函数 继承自 QwtPlotAbstractBarChart | |
| QwtPlotAbstractBarChart (const QwtText &title) | |
| 构造函数 | |
| virtual | ~QwtPlotAbstractBarChart () |
| 析构函数 | |
| void | setLayoutPolicy (LayoutPolicy) |
| 设置布局策略 | |
| LayoutPolicy | layoutPolicy () const |
| 获取布局策略 | |
| void | setLayoutHint (double) |
| 设置布局提示 | |
| double | layoutHint () const |
| 获取布局提示 | |
| void | setSpacing (int) |
| 设置条形之间的间距 | |
| int | spacing () const |
| 获取条形之间的间距 | |
| void | setMargin (int) |
| 设置条形周围的边距 | |
| int | margin () const |
| 获取条形周围的边距 | |
| void | setBaseline (double) |
| 设置基线值 | |
| double | baseline () const |
| 获取基线值 | |
| virtual void | getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const override |
| 计算画布边距的提示 | |
Public 成员函数 继承自 QwtPlotSeriesItem | |
| QwtPlotSeriesItem (const QString &title=QString()) | |
| 构造函数 | |
| QwtPlotSeriesItem (const QwtText &title) | |
| 构造函数 | |
| virtual | ~QwtPlotSeriesItem () |
| 析构函数 | |
| void | setOrientation (Qt::Orientation) |
| 设置绘图项的方向 | |
| Qt::Orientation | orientation () const |
| 获取绘图项的方向 | |
| virtual void | draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override |
| 绘制完整系列 | |
| virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override |
| 更新刻度划分 | |
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 | attach (QwtPlot *plot) |
| Attach the item to a plot | |
| void | detach () |
| Detach the item from the plot | |
| QwtPlot * | plot () 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 QwtText & | title () 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 | 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 | |
Public 成员函数 继承自 QwtSeriesStore< QwtSetSample > | |
| void | setData (QwtSeriesData< QwtSetSample > *series) |
| QwtSeriesData< QwtSetSample > * | data () |
| const QwtSeriesData< QwtSetSample > * | data () const |
| QwtSetSample | 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< QwtSetSample > * | swapData (QwtSeriesData< QwtSetSample > *series) |
Protected 成员函数 | |
| QwtColumnSymbol * | symbol (int valueIndex) |
| Get the symbol for a specific value index | |
| virtual QwtColumnSymbol * | specialSymbol (int sampleIndex, int valueIndex) const |
| Get a special symbol for a specific sample and value index | |
| virtual void | drawSample (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QwtSetSample &) const |
| Draw a sample | |
| virtual void | drawBar (QPainter *, int sampleIndex, int valueIndex, const QwtColumnRect &) const |
| Draw a bar | |
| void | drawStackedBars (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const |
| Draw stacked bars | |
| void | drawGroupedBars (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const |
| Draw grouped bars | |
Protected 成员函数 继承自 QwtPlotAbstractBarChart | |
| 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 | |
QwtPlotMultiBarChart 显示一系列由每组值组成的样本
|
explicit |
Constructor
构造函数
|
explicit |
Constructor with title
构造函数
|
virtual |
Destructor
析构函数
|
overridevirtual |
|
protectedvirtual |
Draw a bar
| painter | Painter |
| sampleIndex | Index of the sample - might be -1 when the bar is painted for the legend |
| valueIndex | Index of a value in a set |
| rect | Directed target rectangle for the bar |
|
protected |
Draw grouped bars
Draw a grouped sample
| painter | Painter |
| xMap | x map |
| yMap | y map |
| canvasRect | Contents rectangle of the canvas |
| index | Index of the sample to be painted |
| sampleWidth | Bounding width for all bars of the sample |
| sample | Sample |
|
protectedvirtual |
Draw a sample
| painter | Painter |
| xMap | x map |
| yMap | y map |
| canvasRect | Contents rectangle of the canvas |
| boundingInterval | Bounding interval of sample values |
| index | Index of the sample to be painted |
| sample | Sample value |
|
overridevirtual |
|
protected |
Draw stacked bars
Draw a stacked sample
| painter | Painter |
| xMap | x map |
| yMap | y map |
| canvasRect | Contents rectangle of the canvas |
| index | Index of the sample to be painted |
| sampleWidth | Width of the bars |
| sample | Sample |
|
overridevirtual |
|
overridevirtual |
| void QwtPlotMultiBarChart::resetSymbolMap | ( | ) |
Reset the symbol map
从符号映射中删除所有符号
|
overridevirtual |
Set the bar titles
设置条形的标题
Set samples from a vector of vectors
使用向量数组初始化数据
| void QwtPlotMultiBarChart::setSamples | ( | const QVector< QwtSetSample > & | samples | ) |
Set samples from a vector of QwtSetSample
使用样本数组初始化数据
| void QwtPlotMultiBarChart::setSamples | ( | QwtSeriesData< QwtSetSample > * | data | ) |
Set samples from a series data
分配样本序列
| void QwtPlotMultiBarChart::setStyle | ( | ChartStyle | style | ) |
Set the chart style
设置图表样式
| void QwtPlotMultiBarChart::setSymbol | ( | int | valueIndex, |
| QwtColumnSymbol * | symbol | ||
| ) |
Set the symbol for a specific value index
将符号添加到符号映射
|
protectedvirtual |
Get a special symbol for a specific sample and value index
Create a symbol for special values
Usually the symbols for displaying a bar are set by setSymbols() and common for all sets. By overloading specialSymbol() it is possible to create a temporary symbol() for displaying a special value.
The symbol has to be created by new each time specialSymbol() is called. As soon as the symbol is painted this symbol gets deleted.
When no symbol ( nullptr ) is returned, the value will be displayed with the standard symbol that is used for all symbols with the same valueIndex.
| sampleIndex | Index of the sample |
| valueIndex | Index of the value in the set |
| QwtPlotMultiBarChart::ChartStyle QwtPlotMultiBarChart::style | ( | ) | const |
Get the chart style
获取图表样式
|
protected |
Get the symbol for a specific value index
Find a symbol in the symbol map
| valueIndex | Index of a value in a set |
| const QwtColumnSymbol * QwtPlotMultiBarChart::symbol | ( | int | valueIndex | ) | const |
Get the symbol for a specific value index
在符号映射中查找符号