PySide6.QtGraphs.QXYSeries¶
- class QXYSeries¶
- The - QXYSeriesclass is a parent class for all x & y series classes.- Details- In - QXYSeries, data points are defined as a list of QPointF, defining X and Y positions.- See also - Inherited by: - QSplineSeries,- QScatterSeries,- QLineSeries- Synopsis¶- Properties¶- colorᅟ- Main color of the series. For QLineSeries this means the line color and for QScatterSeries the color of the point
- countᅟ- Returns the number of data points in a series
- draggableᅟ- Controls if the series is draggable
- pointDelegateᅟ- A custom QML Component used as a marker for data points
- selectedColorᅟ- Color of selected points
- selectedPointsᅟ- Indexes of the points which are currently selected
 - Methods¶- def - append()
- def - appendNp()
- def - at()
- def - clear()
- def - color()
- def - count()
- def - deselectPoint()
- def - deselectPoints()
- def - find()
- def - insert()
- def - isDraggable()
- def - __lshift__()
- def - pointDelegate()
- def - points()
- def - remove()
- def - removeMultiple()
- def - replace()
- def - replaceNp()
- def - selectPoint()
- def - selectPoints()
- def - selectedColor()
- def - selectedPoints()
- def - setColor()
- def - setDraggable()
- def - take()
 - Signals¶- def - clicked()
- def - colorChanged()
- def - countChanged()
- def - doubleClicked()
- def - pointAdded()
- def - pointRemoved()
- def - pointReplaced()
- def - pointsAdded()
- def - pointsRemoved()
- def - pointsReplaced()
- def - pressed()
- def - released()
- def - seriesUpdated()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- This property holds The main color of the series. For - QLineSeriesthis means the line color and for- QScatterSeriesthe color of the point..- Access functions:
- Signal - colorChanged()
 
 - property countᅟ: int¶
 - This property holds Returns the number of data points in a series.. - Access functions:
- Signal - countChanged()
 
 - property draggableᅟ: bool¶
 - This property holds Controls if the series is draggable.. - Controls if the series can be dragged with mouse/touch. By default, - draggableis set to- false.- Access functions:
 - property pointDelegateᅟ: QQmlComponent¶
 - This property holds A custom QML Component used as a marker for data points.. - The dynamic properties available for this component are: - Type - Name - Description - bool - pointSelected - This value is true when the point is selected, meaning that the point index is in - selectedPoints.- QColor - pointColor - The color of the series. This value comes either from the - QGraphsThemeor from- colorif the- QXYSeriesoverrides the color.- QColor - pointBorderColor - The border color of the series. This value comes from the - QGraphsTheme.- QColor - pointSelectedColor - The selected color of the series. This value comes either from the - QGraphsThemeor from- selectedColorif the- QXYSeriesoverrides the color.- qreal - pointBorderWidth - The border width of the series. This value comes from the - QGraphsTheme.- qreal - pointValueX - The value of the QXYPoint::x at this position. - qreal - pointValueY - The value of the QXYPoint::y at this position. - int - pointIndex - The index of the point, from 0 to the amount of points - 1. [since 6.9] - To use any of these, add property with the defined name into your custom component. For example - "property color pointColor"and- "property real pointValueX".- Access functions:
 - This property holds The color of selected points.. - Access functions:
 - property selectedPointsᅟ: list of qsizetype¶
 - This property holds The indexes of the points which are currently selected.. - Access functions:
 - Appends a point with the coordinates - pointto the series.- append(points)
- Parameters:
- points – .list of QPointF 
 
 - Appends points with the coordinates - pointsto the series.- Note - This is much faster than appending data points one by one. Emits - pointsAddedwhen the points have been added.- append(x, y)
- Parameters:
- x – float 
- y – float 
 
 
 - Appends a point with the coordinates - xand- yto the series.- appendNp(x, y)¶
- Parameters:
- x – - PyArrayObject
- y – - PyArrayObject
 
 
 - Adds the list of data points specified by two one-dimensional, equally sized numpy arrays representing the x, y values, respectively. - Returns the point at the position specified by - index. Returns (0, 0) if the index is not valid.- clear()¶
 - Removes all points from the series. - color()¶
- Return type:
 - See also 
 - Getter of property - colorᅟ.- Notification signal of property - colorᅟ.- count()¶
- Return type:
- int 
 
 - Getter of property - countᅟ.- countChanged()¶
 - Notification signal of property - countᅟ.- deselectAllPoints()¶
 - Deselects all points in the series. - deselectPoint(index)¶
- Parameters:
- index – int 
 
 - Deselects point at given - index.- deselectPoints(indexes)¶
- Parameters:
- indexes – .list of qsizetype 
 
 - Marks multiple points passed in a - indexeslist as deselected.- draggableChanged()¶
 - Notification signal of property - draggableᅟ.- Finds and returns the index of the first matching point found as defined by - point. Returns -1 if the point is not found.- Inserts a point with the coordinates - pointto the position specified by- indexin 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.- isDraggable()¶
- Return type:
- bool 
 
 - Getter of property - draggableᅟ.- isPointSelected(index)¶
- Parameters:
- index – int 
- Return type:
- bool 
 
 - Returns true if point at given - indexis among selected points and false otherwise.- Note - Selected points are drawn using the selected color if it was specified. - __lshift__(points)
- Parameters:
- points – .list of QPointF 
- Return type:
 
 - pointAdded(index)¶
- Parameters:
- index – int 
 
 - pointDelegate()¶
- Return type:
 - See also 
 - Getter of property - pointDelegateᅟ.- pointDelegateChanged()¶
 - Notification signal of property - pointDelegateᅟ.- pointRemoved(index)¶
- Parameters:
- index – int 
 
 - pointReplaced(index)¶
- Parameters:
- index – int 
 
 - This signal is emitted when a point is replaced at the position specified by - index.- See also - Returns the points in the series. - pointsAdded(start, end)¶
- Parameters:
- start – int 
- end – int 
 
 
 - This signal is emitted when a list of points is appended. The indexes of the new added points are between - startand- end.- pointsRemoved(index, count)¶
- Parameters:
- index – int 
- count – int 
 
 
 - pointsReplaced()¶
 - This signal is emitted when all points are replaced. - qt_qmlMarker_uncreatable()¶
 - Removes the point with the coordinates - pointfrom the series. Does nothing if the point does not exist.- remove(index)
- Parameters:
- index – int 
 
 - Removes the point at the position specified by - indexfrom the series.- remove(x, y)
- Parameters:
- x – float 
- y – float 
 
 
 - Removes the point with the coordinates - xand- yfrom the series. Does nothing if the point does not exist.- removeMultiple(index, count)¶
- Parameters:
- index – int 
- count – int 
 
 
 - Removes the number of points specified by - countfrom the series starting at the position specified by- index.- replace(points)¶
- Parameters:
- points – .list of QPointF 
 
 - Replaces the current points with the points specified by - points- Note - This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits - pointsReplacedwhen the points have been replaced.- Replaces the point with the coordinates - oldPointwith the point with the coordinates- newPoint. Does nothing if the old point does not exist.- replace(index, newPoint)
- Parameters:
- index – int 
- newPoint – - QPointF
 
 
 - Replaces the point at the position specified by - indexwith the point that has the coordinates- newPoint.- replace(index, newX, newY)
- Parameters:
- index – int 
- newX – float 
- newY – float 
 
 
 - Replaces the point at the position specified by - indexwith the point that has the coordinates- newXand- newY.- replace(oldX, oldY, newX, newY)
- Parameters:
- oldX – float 
- oldY – float 
- newX – float 
- newY – float 
 
 
 - Replaces the point with the coordinates - oldXand- oldYwith the point with the coordinates- newXand- newY. Does nothing if the old point does not exist.- replaceNp(x, y)¶
- Parameters:
- x – - PyArrayObject
- y – - PyArrayObject
 
 
 - Replaces the current points with the points specified by two one-dimensional, equally sized numpy arrays representing the x, y values, respectively. - selectAllPoints()¶
 - Marks all points in the series as selected, - selectPoint(index)¶
- Parameters:
- index – int 
 
 - Marks point at - indexas selected.- selectPoints(indexes)¶
- Parameters:
- indexes – .list of qsizetype 
 
 - Marks multiple points passed in a - indexeslist as selected.- selectedColor()¶
- Return type:
 - See also 
 - Getter of property - selectedColorᅟ.- Notification signal of property - selectedColorᅟ.- selectedPoints()¶
- Return type:
- .list of qsizetype 
 
 - Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility. - See also - Getter of property - selectedPointsᅟ.- selectedPointsChanged()¶
 - Notification signal of property - selectedPointsᅟ.- seriesUpdated()¶
 - Setter of property - colorᅟ.- setDraggable(newDraggable)¶
- Parameters:
- newDraggable – bool 
 - See also 
 - Setter of property - draggableᅟ.- setPointDelegate(newPointDelegate)¶
- Parameters:
- newPointDelegate – - QQmlComponent
 - See also 
 - Setter of property - pointDelegateᅟ.- setPointSelected(index, selected)¶
- Parameters:
- index – int 
- selected – bool 
 
 
 - Marks point at given - indexas either selected or deselected as specified by- selected.- Note - Selected points are drawn using the selected color if it was specified. Emits - selectedPointsChanged- Setter of property - selectedColorᅟ.- Takes a point, specified by - point, out of the series if found. Returns- trueif the operation is successful.- toggleSelection(indexes)¶
- Parameters:
- indexes – .list of qsizetype 
 
 - Changes selection state of points at given - indexesto the opposite one.