PySide6.QtGraphs.QXYSeries¶
- class QXYSeries¶
QXYSeries
类是所有 x 和 y 系列类的父类。更多…继承自:
QScatterSeries
,QLineSeries
,QSplineSeries
概要¶
属性¶
colorᅟ
- 系列的主要颜色。对于QLineSeries,这表示线条颜色;对于QScatterSeries,这表示点的颜色selectedColorᅟ
- 所选系列的主颜色。对于QLineSeries,这表示线条颜色;对于QScatterSeries,这表示点的颜色
方法¶
def
append()
def
appendNp()
def
at()
def
bestFitLinePen()
def
brush()
def
clear()
def
colorBy()
def
count()
def
deselectPoint()
def
deselectPoints()
def
insert()
def
lightMarker()
def
markerSize()
def
pen()
def
points()
def
pointsVector()
def
pointsVisible()
def
remove()
def
removePoints()
def
replace()
def
replaceNp()
def
selectPoint()
def
selectPoints()
def
selectedColor()
def
selectedPoints()
def
setLightMarker()
def
setMarkerSize()
def
sizeBy()
虚拟方法¶
def
color()
def
setBrush()
def
setColor()
def
setPen()
信号¶
def
clicked()
def
colorChanged()
def
doubleClicked()
def
hovered()
def
penChanged()
def
pointAdded()
def
pointRemoved()
def
pointReplaced()
def
pointsRemoved()
def
pointsReplaced()
def
pressed()
def
released()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
在
QXYSeries
中,数据点被定义为QPointF的列表,定义了X和Y的位置。- class PointConfiguration¶
注意
当使用
from __feature__ import true_property
时,属性可以直接使用,否则通过访问器函数使用。- Access functions:
- property bestFitLineVisibleᅟ: bool¶
- Access functions:
此属性保存系列的主要颜色。对于
QLineSeries
,这意味着线条颜色,而对于QScatterSeries
,则是点的颜色。- Access functions:
- property pointLabelsClippingᅟ: bool¶
- Access functions:
- Access functions:
- Access functions:
- property pointLabelsFormatᅟ: str¶
- Access functions:
- property pointLabelsVisibleᅟ: bool¶
- Access functions:
- property pointsVisibleᅟ: bool¶
- Access functions:
此属性保存所选系列的主颜色。对于
QLineSeries
,这意味着线条颜色,而对于QScatterSeries
,则是点的颜色。- Access functions:
- append(points)¶
- Parameters:
points – QPointF 的列表
将具有坐标
points
的点附加到系列中。- append(point)
- Parameters:
点 –
QPointF
- append(x, y)
- Parameters:
x – 浮点数
y – 浮点数
将坐标为
x
和y
的点追加到系列中。- appendNp(x, y)¶
- Parameters:
x –
PyArrayObject
y –
PyArrayObject
添加由两个一维、大小相等的numpy数组指定的数据点列表,分别表示x和y值。
返回由
index
指定的位置处的点。如果索引无效,则返回(0, 0)。属性
bestFitLineColorᅟ
的获取器。属性
bestFitLineColorᅟ
的通知信号。- bestFitLineEquation(ok)¶
- Parameters:
ok – 布尔值
- Return type:
.std.pairqreal,qreal
- bestFitLineVisibilityChanged(visible)¶
- Parameters:
visible – 布尔值
属性
bestFitLineVisibleᅟ
的通知信号。- bestFitLineVisible()¶
- Return type:
布尔
属性
bestFitLineVisibleᅟ
的获取器。- clear()¶
从系列中移除所有点。
- clearPointConfiguration(index)¶
- Parameters:
索引 – int
- clearPointConfiguration(index, key)
- Parameters:
index – 整数
key –
PointConfiguration
- clearPointsConfiguration()¶
- clearPointsConfiguration(key)
- Parameters:
key –
PointConfiguration
- color()¶
- Return type:
另请参阅
属性
colorᅟ
的获取器。- colorBy(sourceData[, gradient=QLinearGradient()])¶
- Parameters:
sourceData – .qreal 的列表
渐变 –
QLinearGradient
属性
colorᅟ
的通知信号。- count()¶
- Return type:
整数
- deselectAllPoints()¶
取消选择系列中的所有点。
- deselectPoint(index)¶
- Parameters:
索引 – int
取消选择给定
index
处的点。- deselectPoints(indexes)¶
- Parameters:
索引 – .整数列表
将
indexes
列表中传递的多个点标记为未选中。将坐标为
point
的点插入到序列中由index
指定的位置。如果索引为0或小于0,则该点将被添加到点列表的开头。如果索引等于或大于序列中的点数,则该点将被添加到点列表的末尾。- isPointSelected(index)¶
- Parameters:
索引 – int
- Return type:
布尔
- markerSize()¶
- Return type:
浮点数
- markerSizeChanged(size)¶
- Parameters:
size – 浮点数
- pointAdded(index)¶
- Parameters:
索引 – int
- pointConfiguration(index)¶
- Parameters:
索引 – int
- Return type:
字典的键类型为 .QXYSeries.PointConfiguration,值类型为 QVariant。
- pointLabelsClipping()¶
- Return type:
布尔
属性
pointLabelsClippingᅟ
的获取器。- pointLabelsClippingChanged(clipping)¶
- Parameters:
clipping – bool
属性
pointLabelsClippingᅟ
的通知信号。属性
pointLabelsColorᅟ
的获取器。属性
pointLabelsColorᅟ
的通知信号。属性
pointLabelsFontᅟ
的获取器。属性
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
指定的位置替换一个点时,会发出此信号。另请参阅
返回系列中的点。
- pointsConfiguration()¶
- Return type:
字典的键类型为 .int,值类型为 QXYSeries.PointConfiguration。
- pointsConfigurationChanged(configuration)¶
- Parameters:
配置 – 字典,键类型为 .int,值类型为 QXYSeries.PointConfiguration。
- pointsRemoved(index, count)¶
- Parameters:
index – 整数
count – int
- pointsReplaced()¶
当所有点被替换时,会发出此信号。
- pointsVisible()¶
- Return type:
布尔
属性
pointsVisibleᅟ
的获取器。- remove(index)
- Parameters:
索引 – int
- remove(x, y)
- Parameters:
x – 浮点数
y – 浮点数
从系列中移除坐标为
x
和y
的点。如果该点不存在,则不执行任何操作。- removePoints(index, count)¶
- Parameters:
index – 整数
count – int
- replace(points)¶
- Parameters:
points – QPointF 的列表
用
points
指定的点替换当前的点注意
这比逐个替换数据点或先清除所有数据再追加新数据要快得多。当点被替换时,会发出
pointsReplaced
。- replace(index, newPoint)
- Parameters:
index – 整数
newPoint –
QPointF
- replace(index, newX, newY)
- Parameters:
index – 整数
newX – 浮点数
newY – 浮点数
用具有坐标
newX
和newY
的点替换由index
指定的位置的点。- replace(oldX, oldY, newX, newY)
- Parameters:
oldX – 浮点数
oldY – 浮点数
newX – 浮点数
newY – 浮点数
用坐标为
newX
和newY
的点替换坐标为oldX
和oldY
的点。如果旧点不存在,则不执行任何操作。- replaceNp(x, y)¶
- Parameters:
x –
PyArrayObject
y –
PyArrayObject
用两个一维、大小相等的numpy数组指定的点替换当前的点,这两个数组分别表示x和y的值。
- selectAllPoints()¶
将系列中的所有点标记为已选择,
- selectPoint(index)¶
- Parameters:
索引 – int
将
index
处的点标记为已选择。- selectPoints(indexes)¶
- Parameters:
索引 – .整数列表
将传入的
indexes
列表中的多个点标记为已选择。- selectedColor()¶
- Return type:
另请参阅
属性
selectedColorᅟ
的通知信号。- selectedPoints()¶
- Return type:
整数列表
返回标记为选中的点的索引列表。无论点的可见性如何,选中的点都是可见的。
另请参阅
- selectedPointsChanged()¶
属性
bestFitLineColorᅟ
的设置器。- setBestFitLineVisible([visible=true])¶
- Parameters:
visible – 布尔值
属性
bestFitLineVisibleᅟ
的设置器。属性
colorᅟ
的设置器。- setMarkerSize(size)¶
- Parameters:
size – 浮点数
- setPointConfiguration(index, configuration)¶
- Parameters:
index – 整数
configuration – 字典,键类型为 .QXYSeries.PointConfiguration,值类型为 QVariant。
- setPointConfiguration(index, key, value)
- Parameters:
index – 整数
key –
PointConfiguration
value – 对象
- setPointLabelsClipping([enabled=true])¶
- Parameters:
enabled – 布尔值
属性
pointLabelsClippingᅟ
的设置器。属性
pointLabelsColorᅟ
的设置器。属性
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ᅟ
的设置器。属性
selectedColorᅟ
的设置器。- sizeBy(sourceData, minSize, maxSize)¶
- Parameters:
sourceData – .qreal 的列表
minSize – 浮点数
maxSize – 浮点数
- toggleSelection(indexes)¶
- Parameters:
索引 – .整数列表
将给定
indexes
处的点的选择状态更改为相反的状态。