PySide6.QtGraphs.QXYSeries

class QXYSeries

QXYSeries 类是所有 x 和 y 系列类的父类。更多

PySide6.QtGraphs.QXYSeries 的继承图

继承自: QScatterSeries, QLineSeries, QSplineSeries

概要

属性

方法

虚拟方法

信号

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

QXYSeries中,数据点被定义为QPointF的列表,定义了X和Y的位置。

class PointConfiguration

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property bestFitLineColorᅟ: QColor
Access functions:
property bestFitLineVisibleᅟ: bool
Access functions:
property colorᅟ: QColor

此属性保存系列的主要颜色。对于QLineSeries,这意味着线条颜色,而对于QScatterSeries,则是点的颜色。

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

此属性保存所选系列的主颜色。对于QLineSeries,这意味着线条颜色,而对于QScatterSeries,则是点的颜色。

Access functions:
append(points)
Parameters:

points – QPointF 的列表

将具有坐标 points 的点附加到系列中。

append(point)
Parameters:

QPointF

append(x, y)
Parameters:
  • x – 浮点数

  • y – 浮点数

将坐标为 xy 的点追加到系列中。

appendNp(x, y)
Parameters:
  • xPyArrayObject

  • yPyArrayObject

添加由两个一维、大小相等的numpy数组指定的数据点列表,分别表示x和y值。

at(index)
Parameters:

索引 – int

Return type:

QPointF

返回由index指定的位置处的点。如果索引无效,则返回(0, 0)。

bestFitLineColor()
Return type:

QColor

属性 bestFitLineColorᅟ 的获取器。

bestFitLineColorChanged(color)
Parameters:

颜色QColor

属性 bestFitLineColorᅟ 的通知信号。

bestFitLineEquation(ok)
Parameters:

ok – 布尔值

Return type:

.std.pairqreal,qreal

bestFitLinePen()
Return type:

QPen

bestFitLinePenChanged(pen)
Parameters:

QPen

bestFitLineVisibilityChanged(visible)
Parameters:

visible – 布尔值

属性 bestFitLineVisibleᅟ 的通知信号。

bestFitLineVisible()
Return type:

布尔

属性 bestFitLineVisibleᅟ 的获取器。

brush()
Return type:

QBrush

clear()

从系列中移除所有点。

clearPointConfiguration(index)
Parameters:

索引 – int

clearPointConfiguration(index, key)
Parameters:
  • index – 整数

  • keyPointConfiguration

clearPointsConfiguration()
clearPointsConfiguration(key)
Parameters:

keyPointConfiguration

clicked(point)
Parameters:

QPointF

color()
Return type:

QColor

另请参阅

setColor()

属性 colorᅟ 的获取器。

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

颜色QColor

属性 colorᅟ 的通知信号。

count()
Return type:

整数

deselectAllPoints()

取消选择系列中的所有点。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

deselectPoint(index)
Parameters:

索引 – int

取消选择给定index处的点。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

deselectPoints(indexes)
Parameters:

索引 – .整数列表

indexes列表中传递的多个点标记为未选中。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

doubleClicked(point)
Parameters:

QPointF

hovered(point, state)
Parameters:
  • QPointF

  • state – 布尔值

insert(index, point)
Parameters:

将坐标为point的点插入到序列中由index指定的位置。如果索引为0或小于0,则该点将被添加到点列表的开头。如果索引等于或大于序列中的点数,则该点将被添加到点列表的末尾。

isPointSelected(index)
Parameters:

索引 – int

Return type:

布尔

lightMarker()
Return type:

QImage

lightMarkerChanged(lightMarker)
Parameters:

lightMarkerQImage

markerSize()
Return type:

浮点数

markerSizeChanged(size)
Parameters:

size – 浮点数

pen()
Return type:

QPen

penChanged(pen)
Parameters:

QPen

pointAdded(index)
Parameters:

索引 – int

pointConfiguration(index)
Parameters:

索引 – int

Return type:

字典的键类型为 .QXYSeries.PointConfiguration,值类型为 QVariant。

pointLabelsClipping()
Return type:

布尔

属性 pointLabelsClippingᅟ 的获取器。

pointLabelsClippingChanged(clipping)
Parameters:

clipping – bool

属性 pointLabelsClippingᅟ 的通知信号。

pointLabelsColor()
Return type:

QColor

属性 pointLabelsColorᅟ 的获取器。

pointLabelsColorChanged(color)
Parameters:

颜色QColor

属性 pointLabelsColorᅟ 的通知信号。

pointLabelsFont()
Return type:

QFont

属性 pointLabelsFontᅟ 的获取器。

pointLabelsFontChanged(font)
Parameters:

字体QFont

属性 pointLabelsFontᅟ 的通知信号。

pointLabelsFormat()
Return type:

字符串

属性 pointLabelsFormatᅟ 的获取器。

pointLabelsFormatChanged(format)
Parameters:

format – str

属性 pointLabelsFormatᅟ 的通知信号。

pointLabelsVisibilityChanged(visible)
Parameters:

visible – 布尔值

属性 pointLabelsVisibleᅟ 的通知信号。

pointLabelsVisible()
Return type:

布尔

属性 pointLabelsVisibleᅟ 的获取器。

pointRemoved(index)
Parameters:

索引 – int

pointReplaced(index)
Parameters:

索引 – int

当在index指定的位置替换一个点时,会发出此信号。

另请参阅

replace()

points()
Return type:

QPointF的列表

返回系列中的点。

pointsConfiguration()
Return type:

字典的键类型为 .int,值类型为 QXYSeries.PointConfiguration。

pointsConfigurationChanged(configuration)
Parameters:

配置 – 字典,键类型为 .int,值类型为 QXYSeries.PointConfiguration。

pointsRemoved(index, count)
Parameters:
  • index – 整数

  • count – int

pointsReplaced()

当所有点被替换时,会发出此信号。

pointsVector()
Return type:

QPointF的列表

注意

此函数已弃用。

pointsVisible()
Return type:

布尔

属性 pointsVisibleᅟ 的获取器。

pressed(point)
Parameters:

QPointF

released(point)
Parameters:

QPointF

remove(point)
Parameters:

QPointF

remove(index)
Parameters:

索引 – int

remove(x, y)
Parameters:
  • x – 浮点数

  • y – 浮点数

从系列中移除坐标为 xy 的点。如果该点不存在,则不执行任何操作。

removePoints(index, count)
Parameters:
  • index – 整数

  • count – int

replace(points)
Parameters:

points – QPointF 的列表

points指定的点替换当前的点

注意

这比逐个替换数据点或先清除所有数据再追加新数据要快得多。当点被替换时,会发出pointsReplaced

replace(oldPoint, newPoint)
Parameters:
replace(index, newPoint)
Parameters:
  • index – 整数

  • newPointQPointF

replace(index, newX, newY)
Parameters:
  • index – 整数

  • newX – 浮点数

  • newY – 浮点数

用具有坐标newXnewY的点替换由index指定的位置的点。

replace(oldX, oldY, newX, newY)
Parameters:
  • oldX – 浮点数

  • oldY – 浮点数

  • newX – 浮点数

  • newY – 浮点数

用坐标为newXnewY的点替换坐标为oldXoldY的点。如果旧点不存在,则不执行任何操作。

replaceNp(x, y)
Parameters:
  • xPyArrayObject

  • yPyArrayObject

用两个一维、大小相等的numpy数组指定的点替换当前的点,这两个数组分别表示x和y的值。

selectAllPoints()

将系列中的所有点标记为已选择,

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

selectPoint(index)
Parameters:

索引 – int

index处的点标记为已选择。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

selectPoints(indexes)
Parameters:

索引 – .整数列表

将传入的indexes列表中的多个点标记为已选择。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()

selectedColor()
Return type:

QColor

另请参阅

setSelectedColor()

selectedColorChanged(color)
Parameters:

颜色QColor

属性 selectedColorᅟ 的通知信号。

selectedLightMarker()
Return type:

QImage

selectedLightMarkerChanged(selectedLightMarker)
Parameters:

selectedLightMarkerQImage

selectedPoints()
Return type:

整数列表

返回标记为选中的点的索引列表。无论点的可见性如何,选中的点都是可见的。

另请参阅

setPointSelected()

selectedPointsChanged()
setBestFitLineColor(color)
Parameters:

颜色QColor

属性 bestFitLineColorᅟ 的设置器。

setBestFitLinePen(pen)
Parameters:

QPen

setBestFitLineVisible([visible=true])
Parameters:

visible – 布尔值

属性 bestFitLineVisibleᅟ 的设置器。

setBrush(brush)
Parameters:

画笔QBrush

setColor(color)
Parameters:

颜色QColor

另请参阅

color()

属性 colorᅟ 的设置器。

setLightMarker(lightMarker)
Parameters:

lightMarkerQImage

setMarkerSize(size)
Parameters:

size – 浮点数

setPen(pen)
Parameters:

QPen

setPointConfiguration(index, configuration)
Parameters:
  • index – 整数

  • configuration – 字典,键类型为 .QXYSeries.PointConfiguration,值类型为 QVariant。

setPointConfiguration(index, key, value)
Parameters:
  • index – 整数

  • keyPointConfiguration

  • value – 对象

setPointLabelsClipping([enabled=true])
Parameters:

enabled – 布尔值

属性 pointLabelsClippingᅟ 的设置器。

setPointLabelsColor(color)
Parameters:

颜色QColor

属性 pointLabelsColorᅟ 的设置器。

setPointLabelsFont(font)
Parameters:

字体QFont

属性 pointLabelsFontᅟ 的设置器。

setPointLabelsFormat(format)
Parameters:

format – str

属性 pointLabelsFormatᅟ 的设置器。

setPointLabelsVisible([visible=true])
Parameters:

visible – 布尔值

属性 pointLabelsVisibleᅟ 的设置器。

setPointSelected(index, selected)
Parameters:
  • index – 整数

  • selected – 布尔值

将给定index处的点标记为selected指定的选中或取消选中状态。

注意

如果指定了所选颜色,则使用所选颜色绘制选定的点。发出 selectedPointsChanged

setPointsConfiguration(pointsConfiguration)
Parameters:

pointsConfiguration – 字典,键类型为 .int,值类型为 QXYSeries.PointConfiguration。

setPointsVisible([visible=true])
Parameters:

visible – 布尔值

属性 pointsVisibleᅟ 的设置器。

setSelectedColor(color)
Parameters:

颜色QColor

另请参阅

selectedColor()

属性 selectedColorᅟ 的设置器。

setSelectedLightMarker(selectedLightMarker)
Parameters:

selectedLightMarkerQImage

sizeBy(sourceData, minSize, maxSize)
Parameters:
  • sourceData – .qreal 的列表

  • minSize – 浮点数

  • maxSize – 浮点数

toggleSelection(indexes)
Parameters:

索引 – .整数列表

将给定indexes处的点的选择状态更改为相反的状态。

注意

发出 selectedPointsChanged

另请参阅

setPointSelected()