PySide6.QtGraphs.QXYSeries

class QXYSeries

The QXYSeries class is a parent class for all x & y series classes. More

Inheritance diagram of PySide6.QtGraphs.QXYSeries

Inherited by: QScatterSeries, QLineSeries, QSplineSeries

Synopsis

Properties

Methods

Virtual methods

Signals

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

Detailed Description

In QXYSeries , data points are defined as a list of QPointF, defining X and Y positions.

class PointConfiguration

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property bestFitLineColorᅟ: QColor
Access functions:
property bestFitLineVisibleᅟ: bool
Access functions:
property 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:
property pointLabelsClippingᅟ: bool
Access functions:
property pointLabelsColorᅟ: QColor
Access functions:
property pointLabelsFontᅟ: QFont
Access functions:
property pointLabelsFormatᅟ: str
Access functions:
property pointLabelsVisibleᅟ: bool
Access functions:
property pointsVisibleᅟ: bool
Access functions:
property 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:
append(points)
Parameters:

points – .list of QPointF

Appends points with the coordinates points to the series.

append(point)
Parameters:

pointQPointF

append(x, y)
Parameters:
  • x – float

  • y – float

Appends a point with the coordinates x and y to the series.

at(index)
Parameters:

index – int

Return type:

QPointF

Returns the point at the position specified by index. Returns (0, 0) if the index is not valid.

bestFitLineColor()
Return type:

QColor

Getter of property bestFitLineColorᅟ .

bestFitLineColorChanged(color)
Parameters:

colorQColor

Notification signal of property bestFitLineColorᅟ .

bestFitLineEquation(ok)
Parameters:

ok – bool

Return type:

.std.pairqreal,qreal

bestFitLinePen()
Return type:

QPen

bestFitLinePenChanged(pen)
Parameters:

penQPen

bestFitLineVisibilityChanged(visible)
Parameters:

visible – bool

Notification signal of property bestFitLineVisibleᅟ .

bestFitLineVisible()
Return type:

bool

Getter of property bestFitLineVisibleᅟ .

brush()
Return type:

QBrush

clear()

Removes all points from the series.

clearPointConfiguration(index)
Parameters:

index – int

clearPointConfiguration(index, key)
Parameters:
  • index – int

  • keyPointConfiguration

clearPointsConfiguration()
clearPointsConfiguration(key)
Parameters:

keyPointConfiguration

clicked(point)
Parameters:

pointQPointF

color()
Return type:

QColor

See also

setColor()

Getter of property colorᅟ .

colorBy(sourceData[, gradient=QLinearGradient()])
Parameters:
colorChanged(color)
Parameters:

colorQColor

Notification signal of property colorᅟ .

count()
Return type:

int

deselectAllPoints()

Deselects all points in the series.

deselectPoint(index)
Parameters:

index – int

Deselects point at given index.

deselectPoints(indexes)
Parameters:

indexes – .list of int

Marks multiple points passed in a indexes list as deselected.

doubleClicked(point)
Parameters:

pointQPointF

hovered(point, state)
Parameters:
insert(index, point)
Parameters:

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.

isPointSelected(index)
Parameters:

index – int

Return type:

bool

lightMarker()
Return type:

QImage

lightMarkerChanged(lightMarker)
Parameters:

lightMarkerQImage

markerSize()
Return type:

float

markerSizeChanged(size)
Parameters:

size – float

pen()
Return type:

QPen

penChanged(pen)
Parameters:

penQPen

pointAdded(index)
Parameters:

index – int

pointConfiguration(index)
Parameters:

index – int

Return type:

Dictionary with keys of type .QXYSeries.PointConfiguration and values of type QVariant.

pointLabelsClipping()
Return type:

bool

Getter of property pointLabelsClippingᅟ .

pointLabelsClippingChanged(clipping)
Parameters:

clipping – bool

Notification signal of property pointLabelsClippingᅟ .

pointLabelsColor()
Return type:

QColor

Getter of property pointLabelsColorᅟ .

pointLabelsColorChanged(color)
Parameters:

colorQColor

Notification signal of property pointLabelsColorᅟ .

pointLabelsFont()
Return type:

QFont

Getter of property pointLabelsFontᅟ .

pointLabelsFontChanged(font)
Parameters:

fontQFont

Notification signal of property pointLabelsFontᅟ .

pointLabelsFormat()
Return type:

str

Getter of property pointLabelsFormatᅟ .

pointLabelsFormatChanged(format)
Parameters:

format – str

Notification signal of property pointLabelsFormatᅟ .

pointLabelsVisibilityChanged(visible)
Parameters:

visible – bool

Notification signal of property pointLabelsVisibleᅟ .

pointLabelsVisible()
Return type:

bool

Getter of property pointLabelsVisibleᅟ .

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

replace()

points()
Return type:

.list of QPointF

Returns the points in the series.

pointsConfiguration()
Return type:

Dictionary with keys of type .int and values of type QXYSeries.PointConfiguration.

pointsConfigurationChanged(configuration)
Parameters:

configuration – Dictionary with keys of type .int and values of type QXYSeries.PointConfiguration.

pointsRemoved(index, count)
Parameters:
  • index – int

  • count – int

pointsReplaced()

This signal is emitted when all points are replaced.

pointsVector()
Return type:

.list of QPointF

Note

This function is deprecated.

pointsVisible()
Return type:

bool

Getter of property pointsVisibleᅟ .

pressed(point)
Parameters:

pointQPointF

released(point)
Parameters:

pointQPointF

remove(point)
Parameters:

pointQPointF

remove(index)
Parameters:

index – int

remove(x, y)
Parameters:
  • x – float

  • y – float

Removes the point with the coordinates x and y from the series. Does nothing if the point does not exist.

removePoints(index, count)
Parameters:
  • index – int

  • count – int

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 pointsReplaced when the points have been replaced.

replace(oldPoint, newPoint)
Parameters:
replace(index, newPoint)
Parameters:
  • index – int

  • newPointQPointF

replace(index, newX, newY)
Parameters:
  • index – int

  • newX – float

  • newY – float

Replaces the point at the position specified by index with the point that has the coordinates newX and newY.

replace(oldX, oldY, newX, newY)
Parameters:
  • oldX – float

  • oldY – float

  • newX – float

  • newY – float

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.

selectAllPoints()

Marks all points in the series as selected,

selectPoint(index)
Parameters:

index – int

Marks point at index as selected.

selectPoints(indexes)
Parameters:

indexes – .list of int

Marks multiple points passed in a indexes list as selected.

selectedColor()
Return type:

QColor

selectedColorChanged(color)
Parameters:

colorQColor

Notification signal of property selectedColorᅟ .

selectedLightMarker()
Return type:

QImage

selectedLightMarkerChanged(selectedLightMarker)
Parameters:

selectedLightMarkerQImage

selectedPoints()
Return type:

.list of int

Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility.

selectedPointsChanged()
setBestFitLineColor(color)
Parameters:

colorQColor

Setter of property bestFitLineColorᅟ .

setBestFitLinePen(pen)
Parameters:

penQPen

setBestFitLineVisible([visible=true])
Parameters:

visible – bool

Setter of property bestFitLineVisibleᅟ .

setBrush(brush)
Parameters:

brushQBrush

setColor(color)
Parameters:

colorQColor

See also

color()

Setter of property colorᅟ .

setLightMarker(lightMarker)
Parameters:

lightMarkerQImage

setMarkerSize(size)
Parameters:

size – float

setPen(pen)
Parameters:

penQPen

setPointConfiguration(index, configuration)
Parameters:
  • index – int

  • configuration – Dictionary with keys of type .QXYSeries.PointConfiguration and values of type QVariant.

setPointConfiguration(index, key, value)
Parameters:
  • index – int

  • keyPointConfiguration

  • value – object

setPointLabelsClipping([enabled=true])
Parameters:

enabled – bool

Setter of property pointLabelsClippingᅟ .

setPointLabelsColor(color)
Parameters:

colorQColor

Setter of property pointLabelsColorᅟ .

setPointLabelsFont(font)
Parameters:

fontQFont

Setter of property pointLabelsFontᅟ .

setPointLabelsFormat(format)
Parameters:

format – str

Setter of property pointLabelsFormatᅟ .

setPointLabelsVisible([visible=true])
Parameters:

visible – bool

Setter of property pointLabelsVisibleᅟ .

setPointSelected(index, selected)
Parameters:
  • index – int

  • selected – bool

Marks point at given index as either selected or deselected as specified by selected.

Note

Selected points are drawn using the selected color if it was specified. Emits selectedPointsChanged

setPointsConfiguration(pointsConfiguration)
Parameters:

pointsConfiguration – Dictionary with keys of type .int and values of type QXYSeries.PointConfiguration.

setPointsVisible([visible=true])
Parameters:

visible – bool

Setter of property pointsVisibleᅟ .

setSelectedColor(color)
Parameters:

colorQColor

See also

selectedColor()

Setter of property selectedColorᅟ .

setSelectedLightMarker(selectedLightMarker)
Parameters:

selectedLightMarkerQImage

sizeBy(sourceData, minSize, maxSize)
Parameters:
  • sourceData – .list of qreal

  • minSize – float

  • maxSize – float

toggleSelection(indexes)
Parameters:

indexes – .list of int

Changes selection state of points at given indexes to the opposite one.