The QXYSeries class is a parent class for all x & y series classes. 更多...
头: | #include <QXYSeries> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
实例化: | XYSeries |
继承: | QAbstractSeries |
继承者: | |
状态: | 技术预览 |
|
void | append (qreal x , qreal y ) |
void | append (const QPointF & point ) |
void | append (const QList<QPointF> & points ) |
const QPointF & | at (int index ) const |
QAbstractAxis * | axisX () const |
QAbstractAxis * | axisY () const |
void | clear () |
virtual QColor | color () const |
int | count () const |
void | deselectAllPoints () |
void | deselectPoint (int index ) |
void | deselectPoints (const QList<int> & indexes ) |
void | insert (int index , const QPointF & point ) |
bool | isPointSelected (int index ) |
qreal | markerSize () const |
QQmlComponent * | pointMarker () const |
QList<QPointF> | points () const |
void | remove (qreal x , qreal y ) |
void | remove (const QPointF & point ) |
void | remove (int index ) |
void | removePoints (int index , int count ) |
void | replace (qreal oldX , qreal oldY , qreal newX , qreal newY ) |
void | replace (const QPointF & oldPoint , const QPointF & newPoint ) |
void | replace (int index , qreal newX , qreal newY ) |
void | replace (int index , const QPointF & newPoint ) |
void | replace (const QList<QPointF> & points ) |
void | selectAllPoints () |
void | selectPoint (int index ) |
void | selectPoints (const QList<int> & indexes ) |
QColor | selectedColor () const |
QList<int> | selectedPoints () const |
void | setAxisX (QAbstractAxis * axis ) |
void | setAxisY (QAbstractAxis * axis ) |
virtual void | setColor (const QColor & newColor ) |
void | setMarkerSize (qreal size ) |
void | setPointMarker (QQmlComponent * newPointMarker ) |
void | setPointSelected (int index , bool selected ) |
void | setSelectedColor (const QColor & color ) |
void | toggleSelection (const QList<int> & indexes ) |
void | axisXChanged () |
void | axisYChanged () |
void | colorChanged (QColor color ) |
void | markerSizeChanged (qreal size ) |
void | pointMarkerChanged () |
void | pointReplaced (int index ) |
void | selectedColorChanged (const QColor & color ) |
In QXYSeries, data points are defined as a list of QPointF , defining X and Y positions.
另请参阅 QLineSeries and QScatterSeries .
X-axis of the series.
The x-axis used for the series. This should be QValueAxis .
访问函数:
QAbstractAxis * | axisX () const |
void | setAxisX (QAbstractAxis * axis ) |
通知程序信号:
void | axisXChanged () |
Y-axis of the series.
The y-axis used for the series. This should be QValueAxis .
访问函数:
QAbstractAxis * | axisY () const |
void | setAxisY (QAbstractAxis * axis ) |
通知程序信号:
void | axisYChanged () |
This property holds the main color of the series. For QLineSeries this means the line color and for QScatterSeries the color of the point.
访问函数:
virtual QColor | color () const |
virtual void | setColor (const QColor & newColor ) |
通知程序信号:
void | colorChanged (QColor color ) |
This property holds the size of the point marker in pixels when using a default circle as a marker. When using pointMarker , the size is defined by the pointMarker conponent.
访问函数:
qreal | markerSize () const |
void | setMarkerSize (qreal size ) |
通知程序信号:
void | markerSizeChanged (qreal size ) |
This property holds a custom QML Component used as a marker for data points.
访问函数:
QQmlComponent * | pointMarker () const |
void | setPointMarker (QQmlComponent * newPointMarker ) |
通知程序信号:
void | pointMarkerChanged () |
This property holds the main color of the selected series. For QLineSeries this means the line color and for QScatterSeries the color of the point.
访问函数:
QColor | selectedColor () const |
void | setSelectedColor (const QColor & color ) |
通知程序信号:
void | selectedColorChanged (const QColor & color ) |
Appends a point with the coordinates x and y 到系列。
Appends a point with the coordinates point 到系列。
Appends points with the coordinates points 到系列。
Returns the point at the position specified by index . Returns (0, 0) if the index is not valid.
从系列删除所有点。
返回系列中的数据点数。
Deselects all points in the series.
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Deselects point at given index .
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Marks multiple points passed in a indexes list as deselected.
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Inserts a point with the coordinates point to the position specified by index in the series. If the index is 0 or less than 0, the point is prepended to the list of points. If the index is equal to or greater than than the number of points in the series, the point is appended to the list of points.
Returns true if point at given index is among selected points and false otherwise.
注意: Selected points are drawn using the selected color if it was specified.
另请参阅 selectedPoints (), setPointSelected (),和 setSelectedColor ().
[signal]
void
QXYSeries::
pointReplaced
(
int
index
)
This signal is emitted when a point is replaced at the position specified by index .
另请参阅 replace ().
Returns the points in the series.
Removes the point with the coordinates x and y from the series. Does nothing if the point does not exist.
Removes the point with the coordinates point from the series. Does nothing if the point does not exist.
Removes the point at the position specified by index from the series.
Removes the number of points specified by count from the series starting at the position specified by index .
Replaces the point with the coordinates oldX and oldY with the point with the coordinates newX and newY . Does nothing if the old point does not exist.
Replaces the point with the coordinates oldPoint with the point with the coordinates newPoint . Does nothing if the old point does not exist.
Replaces the point at the position specified by index with the point that has the coordinates newX and newY .
Replaces the point at the position specified by index with the point that has the coordinates newPoint .
Replaces the current points with the points specified by points
注意: This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits pointReplaced when the points have been replaced.
Marks all points in the series as selected,
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Marks point at index as selected.
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Marks multiple points passed in a indexes list as selected.
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().
Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility.
另请参阅 setPointSelected ().
Marks point at given index as either selected or deselected as specified by selected .
注意: Selected points are drawn using the selected color if it was specified. Emits QXYSeries::selectedPointsChanged
另请参阅 isPointSelected (), selectAllPoints (),和 setSelectedColor ().
Changes selection state of points at given indexes to the opposite one.
注意: Emits QXYSeries::selectedPointsChanged
另请参阅 setPointSelected ().