QXYSeries Class▲
-
Header: QXYSeries
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
-
qmake: QT += graphs
-
Inherited By: QLineSeries and QScatterSeries
-
Instantiated By: qml-qtgraphs-xyseries.xml
-
Inherits: QAbstractSeries
-
Inherited By: QLineSeries and QScatterSeries
-
Group: QXYSeries is part of Qt Graphs C++ Classes for 2D
Detailed Description▲
In QXYSeries, data points are defined as a list of QPointF, defining X and Y positions.
See Also▲
See also QLineSeries, QScatterSeries
Property Documentation▲
axisX : QAbstractAxis*▲
X-axis of the series.
The x-axis used for the series. This should be QValueAxis.
Access functions:
-
*axisX() const
-
void setAxisX( *axis)
Notifier signal:
-
void axisXChanged()
axisY : QAbstractAxis*▲
Y-axis of the series.
The y-axis used for the series. This should be QValueAxis.
Access functions:
-
*axisY() const
-
void setAxisY( *axis)
Notifier signal:
-
void axisYChanged()
color : QColor▲
This property holds the main color of the series. For QLineSeries this means the line color and for QScatterSeries the color of the point.
Access functions:
-
virtual color() const
-
virtual void setColor(const &newColor)
Notifier signal:
-
void colorChanged( color)
markerSize : qreal▲
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.
Access functions:
-
markerSize() const
-
void setMarkerSize( size)
Notifier signal:
-
void markerSizeChanged( size)
pointMarker : QQmlComponent*▲
This property holds a custom QML Component used as a marker for data points.
Access functions:
-
*pointMarker() const
-
void setPointMarker( *newPointMarker)
Notifier signal:
-
void pointMarkerChanged()
selectedColor : QColor▲
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.
Access functions:
-
selectedColor() const
-
void setSelectedColor(const &color)
Notifier signal:
-
void selectedColorChanged(const &color)
Member Function Documentation▲
void QXYSeries::append(qreal x, qreal y)▲
Appends a point with the coordinates x and y to the series.
void QXYSeries::append(const QPointF &point)▲
Appends a point with the coordinates point to the series.
void QXYSeries::append(const QList<QPointF> &points)▲
Appends points with the coordinates points to the series.
const QPointF &QXYSeries::at(int index) const▲
Returns the point at the position specified by index. Returns (0, 0) if the index is not valid.
void QXYSeries::clear()▲
Removes all points from the series.
int QXYSeries::count() const▲
Returns the number of data points in a series.
void QXYSeries::deselectAllPoints()▲
void QXYSeries::deselectPoint(int index)▲
void QXYSeries::deselectPoints(const QList<int> &indexes)▲
void QXYSeries::insert(int index, const QPointF &point)▲
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.
bool QXYSeries::isPointSelected(int index)▲
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.
See Also▲
See also selectedPoints(), setPointSelected(), setSelectedColor()
void QXYSeries::pointReplaced(int index)▲
This signal is emitted when a point is replaced at the position specified by index.
See Also▲
See also replace()
QList<QPointF> QXYSeries::points() const▲
Returns the points in the series.
void QXYSeries::remove(qreal x, qreal y)▲
Removes the point with the coordinates x and y from the series. Does nothing if the point does not exist.
void QXYSeries::remove(const QPointF &point)▲
Removes the point with the coordinates point from the series. Does nothing if the point does not exist.
void QXYSeries::remove(int index)▲
Removes the point at the position specified by index from the series.
void QXYSeries::removePoints(int index, int count)▲
Removes the number of points specified by count from the series starting at the position specified by index.
void QXYSeries::replace(qreal oldX, qreal oldY, qreal newX, qreal newY)▲
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.
void QXYSeries::replace(const QPointF &oldPoint, const QPointF &newPoint)▲
Replaces the point with the coordinates oldPoint with the point with the coordinates newPoint. Does nothing if the old point does not exist.
void QXYSeries::replace(int index, qreal newX, qreal newY)▲
Replaces the point at the position specified by index with the point that has the coordinates newX and newY.
void QXYSeries::replace(int index, const QPointF &newPoint)▲
Replaces the point at the position specified by index with the point that has the coordinates newPoint.
void QXYSeries::replace(const QList<QPointF> &points)▲
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.
void QXYSeries::selectAllPoints()▲
void QXYSeries::selectPoint(int index)▲
void QXYSeries::selectPoints(const QList<int> &indexes)▲
QList<int> QXYSeries::selectedPoints() const▲
Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility.
See Also▲
See also setPointSelected()
void QXYSeries::setPointSelected(int index, bool selected)▲
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
See Also▲
See also isPointSelected(), selectAllPoints(), setSelectedColor()
void QXYSeries::toggleSelection(const QList<int> &indexes)▲
Changes selection state of points at given indexes to the opposite one.
See Also▲
See also setPointSelected()