The QBar3DSeries class represents a data series in a 3D bar graph. 更多...
头: | #include <QBar3DSeries> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
qmake: | QT += datavisualization |
Since: | QtDataVisualization 1.0 |
实例化: | Bar3DSeries |
继承: | QAbstract3DSeries |
QBar3DSeries (QObject * parent = nullptr) | |
QBar3DSeries (QBarDataProxy * dataProxy , QObject * parent = nullptr) | |
virtual | ~QBar3DSeries () |
QBarDataProxy * | dataProxy () const |
float | meshAngle () const |
QList<QColor> | rowColors () const |
QPoint | selectedBar () const |
void | setDataProxy (QBarDataProxy * proxy ) |
void | setMeshAngle (float angle ) |
void | setRowColors (const QList<QColor> & colors ) |
void | setSelectedBar (const QPoint & position ) |
void | dataProxyChanged (QBarDataProxy * proxy ) |
void | meshAngleChanged (float angle ) |
void | rowColorsChanged (const QList<QColor> & rowcolors ) |
void | selectedBarChanged (const QPoint & position ) |
QPoint | invalidSelectionPosition () |
This class manages the series specific visual elements, as well as the series data (via a data proxy).
If no data proxy is set explicitly for the series, the series creates a default proxy. Setting another proxy will destroy the existing proxy and all data added to it.
QBar3DSeries supports the following format tags for QAbstract3DSeries::setItemLabelFormat ():
@rowTitle | Title from row axis |
@colTitle | Title from column axis |
@valueTitle | Title from value axis |
@rowIdx | Visible row index. Localized using the graph locale. |
@colIdx | Visible column index. Localized using the graph locale. |
@rowLabel | Label from row axis |
@colLabel | Label from column axis |
@valueLabel | Item value formatted using the format of the value axis attached to the graph. For more information, see QValue3DAxis::labelFormat . |
@seriesName | Name of the series |
%<format spec> | Item value in the specified format. Formatted using the same rules as QValue3DAxis::labelFormat . |
例如:
proxy->setItemLabelFormat(QStringLiteral("@valueTitle for (@rowLabel, @colLabel): %.1f"));
另请参阅 Qt Data Visualization 数据处理 and QAbstract3DGraph::locale .
This property holds the active data proxy.
The series assumes ownership of any proxy set to it and deletes any previously set proxy when a new one is added. The proxy cannot be null or set to another series.
访问函数:
QBarDataProxy * | dataProxy () const |
void | setDataProxy (QBarDataProxy * proxy ) |
通知程序信号:
void | dataProxyChanged (QBarDataProxy * proxy ) |
This property holds the series rotation angle in degrees.
Setting this property is equivalent to the following call:
setMeshRotation(QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, angle))
注意: When reading this property, it is calculated from the QAbstract3DSeries::meshRotation value using floating point precision and always returns a value from zero to 360 degrees.
访问函数:
float | meshAngle () const |
void | setMeshAngle (float angle ) |
通知程序信号:
void | meshAngleChanged (float angle ) |
另请参阅 QAbstract3DSeries::meshRotation .
[since 6.3]
rowColors
:
QList
<
QColor
>
This property holds the list of row colors in the series.
This property can be used to color the rows of the series in different colors. The Q3DTheme::ColorStyle must be set to Q3DTheme::ColorStyleUniform to use this property.
This property was introduced in Qt 6.3.
访问函数:
QList<QColor> | rowColors () const |
void | setRowColors (const QList<QColor> & colors ) |
通知程序信号:
void | rowColorsChanged (const QList<QColor> & rowcolors ) |
另请参阅 Q3DTheme::ColorStyleUniform .
This property holds the bar in the series that is selected.
访问函数:
QPoint | selectedBar () const |
void | setSelectedBar (const QPoint & position ) |
通知程序信号:
void | selectedBarChanged (const QPoint & position ) |
[explicit]
QBar3DSeries::
QBar3DSeries
(
QObject
*
parent
= nullptr)
Constructsa bar 3D series with the parent parent .
[explicit]
QBar3DSeries::
QBar3DSeries
(
QBarDataProxy
*
dataProxy
,
QObject
*
parent
= nullptr)
Constructs a bar 3D series with the data proxy dataProxy and the parent parent .
[虚拟]
QBar3DSeries::
~QBar3DSeries
()
Deletes a bar 3D series.
[static]
QPoint
QBar3DSeries::
invalidSelectionPosition
()
Returns an invalid position for selection. This position is set to the selectedBar property to clear the selection from this series.
另请参阅 QAbstract3DGraph::clearSelection ().
Selects the bar at the position position, specified as a row and column in the data array of the series.
Only one bar can be selected at a time.
To clear selection from this series, invalidSelectionPosition () is set as position .
If this series is added to a graph, the graph can adjust the selection according to user interaction or if it becomes invalid. Selecting a bar on another added series will also clear the selection.
Removing rows from or inserting rows to the series before the row of the selected bar will adjust the selection so that the same bar will stay selected.
注意: setter 函数对于特性 selectedBar .
另请参阅 selectedBar () 和 QAbstract3DGraph::clearSelection ().