The QAbstractSeries class is a base class for all Qt Graphs for 2D series. 更多...
头: | #include <QAbstractSeries> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
实例化: | AbstractSeries |
继承: | QObject and QQmlParserStatus |
继承者: | |
状态: | 技术预览 |
enum | SeriesType { SeriesTypeLine, SeriesTypeBar, SeriesTypeScatter } |
|
|
virtual | ~QAbstractSeries () |
bool | attachAxis (QAbstractAxis * axis ) |
QList<QAbstractAxis *> | attachedAxes () |
bool | detachAxis (QAbstractAxis * axis ) |
QGraphsView * | graph () const |
void | hide () |
bool | hoverable () const |
bool | isVisible () const |
QString | name () const |
qreal | opacity () const |
bool | selectable () const |
QQmlListProperty<QObject> | seriesChildren () |
void | setHoverable (bool newHoverable ) |
void | setName (const QString & name ) |
void | setOpacity (qreal opacity ) |
void | setSelectable (bool selectable ) |
void | setTheme (QSeriesTheme * newTheme ) |
void | setValuesMultiplier (qreal valuesMultiplier ) |
void | setVisible (bool visible = true) |
void | show () |
QSeriesTheme * | theme () const |
virtual QAbstractSeries::SeriesType | type () const = 0 |
qreal | valuesMultiplier () const |
void | hover (QString seriesName , QPointF position , QPointF value ) |
void | hoverEnter (QString seriesName , QPointF position , QPointF value ) |
void | hoverExit (QString seriesName , QPointF position ) |
void | hoverableChanged () |
void | nameChanged () |
void | opacityChanged () |
void | selectableChanged () |
void | themeChanged () |
void | valuesMultiplierChanged () |
void | visibleChanged () |
通常,使用继承类的特定于系列类型而不是基类。
另请参阅 QLineSeries , QScatterSeries , QBarSeries , QAbstractBarSeries ,和 QXYSeries .
此枚举描述系列的类型。
常量 | 值 | 描述 |
---|---|---|
QAbstractSeries::SeriesTypeLine
|
0
|
线图表。 |
QAbstractSeries::SeriesTypeBar
|
1
|
A vertical bar chart. |
QAbstractSeries::SeriesTypeScatter
|
2
|
散点图表。 |
Controls if the series is hoverable.
Controls if the series can be hovered with mouse/touch. By default,
hoverable
被设为
false
.
访问函数:
bool | hoverable () const |
void | setHoverable (bool newHoverable ) |
通知程序信号:
void | hoverableChanged () |
This property holds the name of the series.
The name is displayed in the legend for the series and it supports HTML formatting.
访问函数:
QString | name () const |
void | setName (const QString & name ) |
通知程序信号:
void | nameChanged () |
This property holds the opacity of the series.
By default, the opacity is 1.0. The valid values range from 0.0 (transparent) to 1.0 (opaque).
访问函数:
qreal | opacity () const |
void | setOpacity (qreal opacity ) |
通知程序信号:
void | opacityChanged () |
Controls if the series is selectable.
Controls if the series can be selected with mouse/touch. By default,
selectable
被设为
false
.
访问函数:
bool | selectable () const |
void | setSelectable (bool selectable ) |
通知程序信号:
void | selectableChanged () |
This property holds the theme of the series.
The theme used for this series.
访问函数:
QSeriesTheme * | theme () const |
void | setTheme (QSeriesTheme * newTheme ) |
通知程序信号:
void | themeChanged () |
[read-only]
type
: const
SeriesType
This property holds the type of the series.
访问函数:
virtual QAbstractSeries::SeriesType | type () const = 0 |
Controls the series values effective visible value.
This variable can be used for animating the series values so they scale from 0 to actual value size. By default, the valuesMultiplier is 1.0. The valid values range from 0.0 (height 0) to 1.0 (full value).
访问函数:
qreal | valuesMultiplier () const |
void | setValuesMultiplier (qreal valuesMultiplier ) |
通知程序信号:
void | valuesMultiplierChanged () |
Visibility of the series.
The visibility used for this series. By default,
visible
被设为
true
.
访问函数:
bool | isVisible () const |
void | setVisible (bool visible = true) |
通知程序信号:
void | visibleChanged () |
[virtual noexcept]
QAbstractSeries::
~QAbstractSeries
()
Virtual destructor for the graph series.
附加轴的指定是通过 axis 到系列。
返回
true
若轴附加成功,
false
否则。
注意: If multiple axes of the same orientation are attached to the same series, they will have the same minimum and maximum values.
Returns the list of axes attached to the series. Usually, an x-axis and a y-axis are attached to a series, except for QPieSeries, which does not have any axes attached.
另请参阅 attachAxis () 和 detachAxis ().
Detaches the axis specified by axis from the series.
返回
true
if the axis was detached successfully,
false
否则。
Returns the graph that the series belongs to.
Set automatically when the series is added to the graph, and unset when the series is removed from the graph.
Sets the visibility of the series to
false
.
另请参阅 setVisible () 和 isVisible ().
[signal]
void
QAbstractSeries::
hover
(
QString
seriesName
,
QPointF
position
,
QPointF
value
)
This signal is emitted when the series hovering changes. The name of the series is in seriesName , the mouse/touch position in position , and the series value in value .
注意: 此信号才被发射当 hoverable is set to true.
[signal]
void
QAbstractSeries::
hoverEnter
(
QString
seriesName
,
QPointF
position
,
QPointF
value
)
This signal is emitted when the series hovering starts. The name of the series is in seriesName , the mouse/touch position in position , and the series value in value .
注意: 此信号才被发射当 hoverable is set to true.
[signal]
void
QAbstractSeries::
hoverExit
(
QString
seriesName
,
QPointF
position
)
This signal is emitted when the series hovering ends. The name of the series is in seriesName , and the mouse/touch position in position .
注意: 此信号才被发射当 hoverable is set to true.
[signal]
void
QAbstractSeries::
hoverableChanged
()
This signal is emitted when the series hoverable changes.
注意: 通知程序信号对于特性 hoverable .
[signal]
void
QAbstractSeries::
nameChanged
()
This signal is emitted when the series name changes.
注意: 通知程序信号对于特性 name .
[signal]
void
QAbstractSeries::
opacityChanged
()
This signal is emitted when the opacity of the series changes.
注意: 通知程序信号对于特性 opacity .
[signal]
void
QAbstractSeries::
selectableChanged
()
This signal is emitted when the series selectable changes.
注意: 通知程序信号对于特性 selectable .
Sets the visibility of the series to
true
.
另请参阅 setVisible () 和 isVisible ().
[signal]
void
QAbstractSeries::
themeChanged
()
This signal is emitted when the series theme changes.
注意: 通知程序信号对于特性 theme .
[signal]
void
QAbstractSeries::
valuesMultiplierChanged
()
此信号发射当 valuesMultiplier of the series changes.
注意: 通知程序信号对于特性 valuesMultiplier .
[signal]
void
QAbstractSeries::
visibleChanged
()
This signal is emitted when the series visibility changes.
注意: 通知程序信号对于特性 visible .