QXYSeries#
The QXYSeries
class is a base class for line, spline, and scatter series. More…
Inherited by: QScatterSeries, QLineSeries, QSplineSeries
Synopsis#
Properties#
bestFitLineColor
- Color of best fit linebestFitLineVisible
- Visibility of the best fit linecolor
- Of the seriespointLabelsClipping
- Clipping for data point labelspointLabelsColor
- Color used for data point labels. By default, the color is the color of the brush defined in theme for labelspointLabelsFont
- Font used for data point labelspointLabelsFormat
- Format used for showing labels with data pointspointLabelsVisible
- Visibility of data point labelspointsVisible
- Whether the data points are visible and should be drawnselectedColor
- Color of the selected points
Functions#
def
append
(point)def
append
(points)def
append
(x, y)def
appendNp
(x, y)def
at
(index)def
bestFitLineColor
()def
bestFitLineEquation
(ok)def
bestFitLinePen
()def
bestFitLineVisible
()def
brush
()def
clear
()def
clearPointConfiguration
(index)def
clearPointConfiguration
(index, key)def
clearPointsConfiguration
()def
clearPointsConfiguration
(key)def
colorBy
(sourceData[, gradient=QLinearGradient()])def
count
()def
deselectAllPoints
()def
deselectPoint
(index)def
deselectPoints
(indexes)def
insert
(index, point)def
isPointSelected
(index)def
lightMarker
()def
markerSize
()def
__lshift__
(points)def
__lshift__
(point)def
pen
()def
pointConfiguration
(index)def
pointLabelsClipping
()def
pointLabelsColor
()def
pointLabelsFont
()def
pointLabelsFormat
()def
pointLabelsVisible
()def
points
()def
pointsConfiguration
()def
pointsVector
()def
pointsVisible
()def
remove
(point)def
remove
(index)def
remove
(x, y)def
removePoints
(index, count)def
replace
(oldPoint, newPoint)def
replace
(oldX, oldY, newX, newY)def
replace
(index, newX, newY)def
replace
(index, newPoint)def
replace
(points)def
replaceNp
(x, y)def
selectAllPoints
()def
selectPoint
(index)def
selectPoints
(indexes)def
selectedColor
()def
selectedLightMarker
()def
selectedPoints
()def
setBestFitLineColor
(color)def
setBestFitLinePen
(pen)def
setBestFitLineVisible
([visible=true])def
setLightMarker
(lightMarker)def
setMarkerSize
(size)def
setPointConfiguration
(index, configuration)def
setPointConfiguration
(index, key, value)def
setPointLabelsClipping
([enabled=true])def
setPointLabelsColor
(color)def
setPointLabelsFont
(font)def
setPointLabelsFormat
(format)def
setPointLabelsVisible
([visible=true])def
setPointSelected
(index, selected)def
setPointsConfiguration
(pointsConfiguration)def
setPointsVisible
([visible=true])def
setSelectedColor
(color)def
setSelectedLightMarker
(selectedLightMarker)def
sizeBy
(sourceData, minSize, maxSize)def
toggleSelection
(indexes)
Virtual functions#
Signals#
def
bestFitLineColorChanged
(color)def
bestFitLinePenChanged
(pen)def
bestFitLineVisibilityChanged
(visible)def
clicked
(point)def
colorChanged
(color)def
doubleClicked
(point)def
hovered
(point, state)def
lightMarkerChanged
(lightMarker)def
markerSizeChanged
(size)def
penChanged
(pen)def
pointAdded
(index)def
pointLabelsClippingChanged
(clipping)def
pointLabelsColorChanged
(color)def
pointLabelsFontChanged
(font)def
pointLabelsFormatChanged
(format)def
pointLabelsVisibilityChanged
(visible)def
pointRemoved
(index)def
pointReplaced
(index)def
pointsConfigurationChanged
(configuration)def
pointsRemoved
(index, count)def
pointsReplaced
()def
pressed
(point)def
released
(point)def
selectedColorChanged
(color)def
selectedLightMarkerChanged
(selectedLightMarker)def
selectedPointsChanged
()
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#
QXYSeries
supports displaying best fit line on a chart. Best fit line is a line through a chart that expresses the relationship between points.
- class PySide6.QtCharts.QXYSeries#
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtCharts.QXYSeries.bestFitLineColor: PySide6.QtGui.QColor#
This property holds The color of best fit line..
See also
- Access functions:
setBestFitLineColor
(color)Signal
bestFitLineColorChanged
(color)
- property PᅟySide6.QtCharts.QXYSeries.bestFitLineVisible: bool#
This property holds The visibility of the best fit line..
This property is false
by default.
See also
- Access functions:
setBestFitLineVisible
([visible=true])Signal
bestFitLineVisibilityChanged
(visible)
- property PᅟySide6.QtCharts.QXYSeries.color: PySide6.QtGui.QColor#
This property holds The color of the series..
This is the line (pen) color in case of QLineSeries
or QSplineSeries
and the fill (brush) color in case of QScatterSeries
or QAreaSeries
.
- Access functions:
color
()setColor
(color)Signal
colorChanged
(color)
- property PᅟySide6.QtCharts.QXYSeries.pointLabelsClipping: bool#
This property holds The clipping for data point labels..
This property is true
by default. The labels on the edge of the plot area are cut when clipping is enabled.
See also
- Access functions:
setPointLabelsClipping
([enabled=true])Signal
pointLabelsClippingChanged
(clipping)
- property PᅟySide6.QtCharts.QXYSeries.pointLabelsColor: PySide6.QtGui.QColor#
This property holds The color used for data point labels. By default, the color is the color of the brush defined in theme for labels..
See also
- Access functions:
setPointLabelsColor
(color)Signal
pointLabelsColorChanged
(color)
- property PᅟySide6.QtCharts.QXYSeries.pointLabelsFont: PySide6.QtGui.QFont#
This property holds The font used for data point labels..
See also
- Access functions:
setPointLabelsFont
(font)Signal
pointLabelsFontChanged
(font)
- property PᅟySide6.QtCharts.QXYSeries.pointLabelsFormat: str#
This property holds The format used for showing labels with data points..
QXYSeries
supports the following format tags:
@index
The index in the series of the data point. [since 6.5]
@xPoint
The x-coordinate of the data point.
@yPoint
The y-coordinate of the data point.
For example, the following usage of the format tags would produce labels that display the data point shown inside brackets separated by a comma (x, y):
series->setPointLabelsFormat("@index: (@xPoint, @yPoint)");
By default, the labels’ format is set to @xPoint, @yPoint
. The labels are shown on the plot area, and the labels on the edge of the plot area are cut. If the points are close to each other, the labels may overlap.
- Access functions:
setPointLabelsFormat
(format)Signal
pointLabelsFormatChanged
(format)
- property PᅟySide6.QtCharts.QXYSeries.pointLabelsVisible: bool#
This property holds The visibility of data point labels..
This property is false
by default.
See also
- Access functions:
setPointLabelsVisible
([visible=true])Signal
pointLabelsVisibilityChanged
(visible)
- property PᅟySide6.QtCharts.QXYSeries.pointsVisible: bool#
This property holds Whether the data points are visible and should be drawn..
- Access functions:
setPointsVisible
([visible=true])
- property PᅟySide6.QtCharts.QXYSeries.selectedColor: PySide6.QtGui.QColor#
This property holds The color of the selected points..
This is the fill (brush) color of points marked as selected. If not specified, value of color
is used as default.
See also
- Access functions:
color
()setSelectedColor
(color)Signal
selectedColorChanged
(color)
- PySide6.QtCharts.QXYSeries.PointConfiguration#
This enum value describes the particular configuration of a point.
Constant
Description
QXYSeries.PointConfiguration.Color
This enum value can be used to change a point’s color. If used together with
setPointConfiguration
, the configuration’s value should be a validQColor
.QXYSeries.PointConfiguration.Size
This enum value can be used to change a point’s size. If used together with
setPointConfiguration
, the configuration’s value should be a number, such asqreal
orint
.QXYSeries.PointConfiguration.Visibility
This enum value can be used to hide or show the point. If used together with
setPointConfiguration
, the configuration’s value should be boolean.QXYSeries.PointConfiguration.LabelVisibility
This enum value can be used to hide or show the label of the point. If used together with
setPointConfiguration
, the configuration’s value should be boolean.QXYSeries.PointConfiguration.LabelFormat
This enum value can be used to set custom label text per-point. If used together with
setPointConfiguration
, the configuration’s value should be a string.
Note
If an empty string is set as the LabelFormat, it will be ignored, and the series pointLabelsFormat
will be used.
See also
- PySide6.QtCharts.QXYSeries.append(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
This is an overloaded function.
Adds the data point point
to the series.
- PySide6.QtCharts.QXYSeries.append(points)
- Parameters:
points –
This is an overloaded function.
Adds the list of data points specified by points
to the series.
- PySide6.QtCharts.QXYSeries.append(x, y)
- Parameters:
x – float
y – float
Adds the data point with the coordinates x
and y
to the series.
- PySide6.QtCharts.QXYSeries.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.
- PySide6.QtCharts.QXYSeries.at(index)#
- Parameters:
index – int
- Return type:
Returns the data point at the position specified by index
in the internal series of points.
- PySide6.QtCharts.QXYSeries.bestFitLineColor()#
- Return type:
See also
Getter of property bestFitLineColor
.
- PySide6.QtCharts.QXYSeries.bestFitLineColorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the color used for the best fit line changes to color
.
Notification signal of property bestFitLineColor
.
- PySide6.QtCharts.QXYSeries.bestFitLineEquation(ok)#
- Parameters:
ok – bool
Returns a pair of numbers where the first number is a slope factor and the second number is intercept of a linear function for a best fit line.
Those factors are calculated using Least Squares Method based on points passed to the series.
Parameter ok
is used to report a failure by setting its value to false
and to report a success by setting its value to true
.
See also
- PySide6.QtCharts.QXYSeries.bestFitLinePen()#
- Return type:
- PySide6.QtCharts.QXYSeries.bestFitLinePenChanged(pen)#
- Parameters:
pen –
PySide6.QtGui.QPen
- PySide6.QtCharts.QXYSeries.bestFitLineVisibilityChanged(visible)#
- Parameters:
visible – bool
This signal is emitted when the visibility of the best fit line changes to visible
.
Notification signal of property bestFitLineVisible
.
- PySide6.QtCharts.QXYSeries.bestFitLineVisible()#
- Return type:
bool
See also
Getter of property bestFitLineVisible
.
- PySide6.QtCharts.QXYSeries.brush()#
- Return type:
Returns the brush used to fill the data points for the series.
See also
- PySide6.QtCharts.QXYSeries.clear()#
Removes all points from the series.
See also
- PySide6.QtCharts.QXYSeries.clearPointConfiguration(index)#
- Parameters:
index – int
Removes the configuration of a point located at index
and restores the default look derived from the series’ settings.
Note
It doesn’t affect the configuration of other points.
- PySide6.QtCharts.QXYSeries.clearPointConfiguration(index, key)
- Parameters:
index – int
key –
PointConfiguration
Removes the configuration property identified by key
from the point at index
and restores the default look derived from the series’ settings.
Removes the configuration type, such as color or size, specified by key
from the point at index
with configuration customizations, allowing that configuration property to be rendered as the default specified in the series’ properties.
Note
It doesn’t affect the configuration of other points.
- PySide6.QtCharts.QXYSeries.clearPointsConfiguration()#
Removes the configuration of all points in the series and restores the default look derived from the series’ settings.
See also
- PySide6.QtCharts.QXYSeries.clearPointsConfiguration(key)
- Parameters:
key –
PointConfiguration
Removes the configuration property identified by key
from all points and restores the default look derived from the series’ settings.
Removes the configuration type, such as color or size, specified by key
from all points with configuration customizations, allowing that configuration property to be rendered as the default specified in the series properties.
- PySide6.QtCharts.QXYSeries.clicked(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
This signal is emitted when the user triggers a mouse event by clicking the point point
in the chart.
See also
- PySide6.QtCharts.QXYSeries.color()#
- Return type:
See also
Getter of property color
.
- PySide6.QtCharts.QXYSeries.colorBy(sourceData[, gradient=QLinearGradient()])#
- Parameters:
sourceData –
gradient –
PySide6.QtGui.QLinearGradient
Sets the points’ color according to a passed list of values. Values from sourceData
are sorted and mapped to the gradient
.
If the series has a QColorAxis
attached, then a gradient from the axis is going to be used.
See also
setPointConfiguration()
pointConfiguration()
QColorAxis
- PySide6.QtCharts.QXYSeries.colorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the line (pen) color changes to color
.
Notification signal of property color
.
- PySide6.QtCharts.QXYSeries.count()#
- Return type:
int
Returns the number of data points in a series.
- PySide6.QtCharts.QXYSeries.deselectAllPoints()#
Deselects all points in the series.
- PySide6.QtCharts.QXYSeries.deselectPoint(index)#
- Parameters:
index – int
Deselects point at given index
.
- PySide6.QtCharts.QXYSeries.deselectPoints(indexes)#
- Parameters:
indexes –
Marks multiple points passed in a indexes
list as deselected.
- PySide6.QtCharts.QXYSeries.doubleClicked(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
This signal is emitted when the user double-clicks the data point point
in the chart. The point
is the point where the first press was triggered.
See also
- PySide6.QtCharts.QXYSeries.hovered(point, state)#
- Parameters:
point –
PySide6.QtCore.QPointF
state – bool
This signal is emitted when a mouse is hovered over the point point
in the chart. When the mouse moves over the point, state
turns true
, and when the mouse moves away again, it turns false
.
- PySide6.QtCharts.QXYSeries.insert(index, point)#
- Parameters:
index – int
point –
PySide6.QtCore.QPointF
Inserts the data point point
in the series at the position specified by index
.
See also
- PySide6.QtCharts.QXYSeries.isPointSelected(index)#
- Parameters:
index – int
- Return type:
bool
Returns true if point at given index
is among selected points and false otherwise.
Note
Selected points are drawn using the selected color if it was specified.
- PySide6.QtCharts.QXYSeries.lightMarker()#
- Return type:
Gets the image used for drawing markers on each point of the series.
The default value is QImage(), meaning no light marker will be painted.
The light markers visualize the data points of this series and as such are an alternative to setPointsVisible
(true). Both features can be enabled independently from each other.
Unlike the elements of QScatterSeries
the light markers are not represented by QGraphicsItem
, but are just painted (no objects created). However, the mouse-event-signals of QXYSeries
behave the same way, meaning that you’ll get the exact domain value of the point if you click/press/hover the light marker. You’ll still get the in between domain value if you click on the line. The light markers are above the line in terms of painting as well as events.
See also
- PySide6.QtCharts.QXYSeries.lightMarkerChanged(lightMarker)#
- Parameters:
lightMarker –
PySide6.QtGui.QImage
This signal is emitted when the light marker image changes to lightMarker
.
See also
- PySide6.QtCharts.QXYSeries.markerSize()#
- Return type:
float
Gets the size of the marker used to render points in the series.
The default size depends on the specific QXYSeries
type. QScatterSeries
has a default of 15.0 QLineSeries
has a default of the series pen size * 1.5
See also
setMarkerSize()
markerSize
- PySide6.QtCharts.QXYSeries.markerSizeChanged(size)#
- Parameters:
size – float
This signal is emitted when the marker size changes to size
.
- PySide6.QtCharts.QXYSeries.__lshift__(points)#
- Parameters:
points –
- Return type:
Stream operator for adding the list of data points specified by points
to the series.
See also
- PySide6.QtCharts.QXYSeries.__lshift__(point)
- Parameters:
point –
PySide6.QtCore.QPointF
- Return type:
Stream operator for adding the data point point
to the series.
See also
- PySide6.QtCharts.QXYSeries.pen()#
- Return type:
Returns the pen used to draw the outline of the data points for the series.
See also
- PySide6.QtCharts.QXYSeries.penChanged(pen)#
- Parameters:
pen –
PySide6.QtGui.QPen
This signal is emitted when the pen changes to pen
.
- PySide6.QtCharts.QXYSeries.pointAdded(index)#
- Parameters:
index – int
This signal is emitted when a point is added at the position specified by index
.
- PySide6.QtCharts.QXYSeries.pointConfiguration(index)#
- Parameters:
index – int
Returns a map representing the configuration of a point at index
.
With points configuration you can change various aspects of each point’s look.
See also
- PySide6.QtCharts.QXYSeries.pointLabelsClipping()#
- Return type:
bool
See also
Getter of property pointLabelsClipping
.
- PySide6.QtCharts.QXYSeries.pointLabelsClippingChanged(clipping)#
- Parameters:
clipping – bool
This signal is emitted when the clipping of the data point labels changes to clipping
.
Notification signal of property pointLabelsClipping
.
- PySide6.QtCharts.QXYSeries.pointLabelsColor()#
- Return type:
See also
Getter of property pointLabelsColor
.
- PySide6.QtCharts.QXYSeries.pointLabelsColorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the color used for data point labels changes to color
.
Notification signal of property pointLabelsColor
.
- PySide6.QtCharts.QXYSeries.pointLabelsFont()#
- Return type:
See also
Getter of property pointLabelsFont
.
- PySide6.QtCharts.QXYSeries.pointLabelsFontChanged(font)#
- Parameters:
font –
PySide6.QtGui.QFont
This signal is emitted when the font used for data point labels changes to font
.
Notification signal of property pointLabelsFont
.
- PySide6.QtCharts.QXYSeries.pointLabelsFormat()#
- Return type:
str
See also
Getter of property pointLabelsFormat
.
- PySide6.QtCharts.QXYSeries.pointLabelsFormatChanged(format)#
- Parameters:
format – str
This signal is emitted when the format of data point labels changes to format
.
Notification signal of property pointLabelsFormat
.
- PySide6.QtCharts.QXYSeries.pointLabelsVisibilityChanged(visible)#
- Parameters:
visible – bool
This signal is emitted when the visibility of the data point labels changes to visible
.
Notification signal of property pointLabelsVisible
.
- PySide6.QtCharts.QXYSeries.pointLabelsVisible()#
- Return type:
bool
See also
Getter of property pointLabelsVisible
.
- PySide6.QtCharts.QXYSeries.pointRemoved(index)#
- Parameters:
index – int
This signal is emitted when a point is removed from the position specified by index
.
See also
- PySide6.QtCharts.QXYSeries.pointReplaced(index)#
- Parameters:
index – int
This signal is emitted when a point is replaced at the position specified by index
.
See also
- PySide6.QtCharts.QXYSeries.points()#
Returns the points in the series.
- PySide6.QtCharts.QXYSeries.pointsConfiguration()#
Returns a map with points’ indexes as keys and points’ configuration as values.
- PySide6.QtCharts.QXYSeries.pointsConfigurationChanged(configuration)#
- Parameters:
configuration –
- PySide6.QtCharts.QXYSeries.pointsRemoved(index, count)#
- Parameters:
index – int
count – int
This signal is emitted when the number of points specified by count
is removed starting at the position specified by index
.
See also
- PySide6.QtCharts.QXYSeries.pointsReplaced()#
This signal is emitted when all points are replaced with other points.
See also
- PySide6.QtCharts.QXYSeries.pointsVector()#
Note
This function is deprecated.
Use points()
instead. Returns the points in the series.
- PySide6.QtCharts.QXYSeries.pointsVisible()#
- Return type:
bool
See also
Getter of property pointsVisible
.
- PySide6.QtCharts.QXYSeries.pressed(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
This signal is emitted when the user presses the data point point
in the chart and holds down the mouse button.
See also
- PySide6.QtCharts.QXYSeries.released(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
This signal is emitted when the user releases the mouse press on the data point specified by point
.
See also
- PySide6.QtCharts.QXYSeries.remove(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
Removes the data point point
from the series.
See also
- PySide6.QtCharts.QXYSeries.remove(index)
- Parameters:
index – int
Removes the point at the position specified by index
from the series.
See also
- PySide6.QtCharts.QXYSeries.remove(x, y)
- Parameters:
x – float
y – float
Removes the point that has the coordinates x
and y
from the series.
See also
- PySide6.QtCharts.QXYSeries.removePoints(index, count)#
- Parameters:
index – int
count – int
Removes the number of points specified by count
from the series starting at the position specified by index
.
See also
- PySide6.QtCharts.QXYSeries.replace(oldPoint, newPoint)#
- Parameters:
oldPoint –
PySide6.QtCore.QPointF
newPoint –
PySide6.QtCore.QPointF
Replaces the point specified by oldPoint
with the one specified by newPoint
.
See also
- PySide6.QtCharts.QXYSeries.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.
See also
- PySide6.QtCharts.QXYSeries.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
.
See also
- PySide6.QtCharts.QXYSeries.replace(index, newPoint)
- Parameters:
index – int
newPoint –
PySide6.QtCore.QPointF
Replaces the point at the position specified by index
with the point specified by newPoint
.
See also
- PySide6.QtCharts.QXYSeries.replace(points)
- Parameters:
points –
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.
See also
- PySide6.QtCharts.QXYSeries.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.
- PySide6.QtCharts.QXYSeries.selectAllPoints()#
Marks all points in the series as selected,
- PySide6.QtCharts.QXYSeries.selectPoint(index)#
- Parameters:
index – int
Marks point at index
as selected.
- PySide6.QtCharts.QXYSeries.selectPoints(indexes)#
- Parameters:
indexes –
Marks multiple points passed in a indexes
list as selected.
- PySide6.QtCharts.QXYSeries.selectedColor()#
- Return type:
- PySide6.QtCharts.QXYSeries.selectedColorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Notification signal of property selectedColor
.
- PySide6.QtCharts.QXYSeries.selectedLightMarker()#
- Return type:
Returns the image used for drawing markers on selected series’ points.
The default value is QImage(), meaning usual lightMarker()
will be painted.
This is equivalent to selectedColor
if you prefer light markers over normal points, but still want to distinguish selected points.
- PySide6.QtCharts.QXYSeries.selectedLightMarkerChanged(selectedLightMarker)#
- Parameters:
selectedLightMarker –
PySide6.QtGui.QImage
- PySide6.QtCharts.QXYSeries.selectedPoints()#
Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility.
See also
- PySide6.QtCharts.QXYSeries.selectedPointsChanged()#
This signal is emitted when the points selection changes.
- PySide6.QtCharts.QXYSeries.setBestFitLineColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
See also
Setter of property bestFitLineColor
.
- PySide6.QtCharts.QXYSeries.setBestFitLinePen(pen)#
- Parameters:
pen –
PySide6.QtGui.QPen
- PySide6.QtCharts.QXYSeries.setBestFitLineVisible([visible=true])#
- Parameters:
visible – bool
See also
Setter of property bestFitLineVisible
.
- PySide6.QtCharts.QXYSeries.setBrush(brush)#
- Parameters:
brush –
PySide6.QtGui.QBrush
Sets the brush used for drawing points on the chart to brush
. If the brush is not defined, the brush from the chart theme setting is used.
See also
- PySide6.QtCharts.QXYSeries.setColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
See also
Setter of property color
.
- PySide6.QtCharts.QXYSeries.setLightMarker(lightMarker)#
- Parameters:
lightMarker –
PySide6.QtGui.QImage
Sets the image used for drawing markers on each point of the series as the value of lightMarker
.
The default value is a default-QImage() ( isNull()
== true), meaning no light marker will be painted. You can reset back to default (disabled) by calling this function with a null QImage
(QImage()).
The light markers visualize the data points of this series and as such are an alternative to setPointsVisible(true)
. If a light marker is set with this method, visible points as set with setPointsVisible(true)
are not displayed.
Unlike the elements of QScatterSeries
the light markers are not represented by QGraphicsItem
, but are just painted (no objects created). However, the mouse-event-signals of QXYSeries
behave the same way, meaning that you’ll get the exact domain value of the point if you click/press/hover the light marker. You’ll still get the in between domain value if you click on the line. The light markers are above the line in terms of painting as well as events.
See also
- PySide6.QtCharts.QXYSeries.setMarkerSize(size)#
- Parameters:
size – float
Sets the size
of the marker used to render points in the series.
The default size is 15.0.
See also
markerSize
- PySide6.QtCharts.QXYSeries.setPen(pen)#
- Parameters:
pen –
PySide6.QtGui.QPen
Sets the pen used for drawing points on the chart to pen
. If the pen is not defined, the pen from the chart theme is used.
See also
- PySide6.QtCharts.QXYSeries.setPointConfiguration(index, configuration)#
- Parameters:
index – int
configuration –
Enables customizing the appearance of a point located at index
with desired configuration
.
With points configuration you can change various aspects of every point’s appearance.
A point’s configuration is represented as a hash map with pointConfiguration
keys and QVariant
values. For example:
QLineSeries *series = new QLineSeries(); series->setName("Customized series"); series->setPointsVisible(true); *series << QPointF(0, 6) << QPointF(2, 4) << QPointF(3, 6) << QPointF(7, 4) << QPointF(10, 5) << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2); QChart *chart = new QChart(); chart->addSeries(series); chart->createDefaultAxes(); QHash<QXYSeries::PointConfiguration, QVariant> conf; conf[QXYSeries::PointConfiguration::Color] = QColor(Qt::red); conf[QXYSeries::PointConfiguration::Size] = 8; conf[QXYSeries::PointConfiguration::LabelVisibility] = true; series->setPointConfiguration(4, conf); conf.remove(QXYSeries::PointConfiguration::Color); conf[QXYSeries::PointConfiguration::LabelFormat] = "This Point"; series->setPointConfiguration(6, conf);
In this example, you can see a default QLineSeries
with 10 points and with changed configuration of two points. Both changed points are visibly bigger than the others with a look derived from the series configuration. By default, points don’t have labels, but the point at index 4 has a label thanks to the LabelVisibility
and LabelFormat
configuration values. The point at index 6 has a custom label This Point thanks to the LabelFormat
configuration value. Below is an example of a chart created in this way:
- PySide6.QtCharts.QXYSeries.setPointConfiguration(index, key, value)
- Parameters:
index – int
key –
PointConfiguration
value – object
Enables customizing a particular aspect of a point’s configuration.
Note
Points configuration concept provides a flexible way to configure various aspects of a point’s appearance. Thus, values need to have an elastic type such as QVariant
. See PointConfiguration
to see what value
should be passed for certain key
.
See also
- PySide6.QtCharts.QXYSeries.setPointLabelsClipping([enabled=true])#
- Parameters:
enabled – bool
See also
Setter of property pointLabelsClipping
.
- PySide6.QtCharts.QXYSeries.setPointLabelsColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
See also
Setter of property pointLabelsColor
.
- PySide6.QtCharts.QXYSeries.setPointLabelsFont(font)#
- Parameters:
font –
PySide6.QtGui.QFont
See also
Setter of property pointLabelsFont
.
- PySide6.QtCharts.QXYSeries.setPointLabelsFormat(format)#
- Parameters:
format – str
See also
Setter of property pointLabelsFormat
.
- PySide6.QtCharts.QXYSeries.setPointLabelsVisible([visible=true])#
- Parameters:
visible – bool
See also
Setter of property pointLabelsVisible
.
- PySide6.QtCharts.QXYSeries.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
See also
- PySide6.QtCharts.QXYSeries.setPointsConfiguration(pointsConfiguration)#
- Parameters:
pointsConfiguration –
Enables customizing the configuration of multiple points as specified by pointsConfiguration
.
See also
- PySide6.QtCharts.QXYSeries.setPointsVisible([visible=true])#
- Parameters:
visible – bool
See also
Setter of property pointsVisible
.
- PySide6.QtCharts.QXYSeries.setSelectedColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Setter of property selectedColor
.
- PySide6.QtCharts.QXYSeries.setSelectedLightMarker(selectedLightMarker)#
- Parameters:
selectedLightMarker –
PySide6.QtGui.QImage
Sets the image used for drawing markers on selected series’s points to selectedLightMarker
.
The default value is QImage(), meaning usual lightMarker()
will be painted.
This is an equivalent for selectedColor
if you prefer light markers over normal points, but still want to distinguish selected points.
- PySide6.QtCharts.QXYSeries.sizeBy(sourceData, minSize, maxSize)#
- Parameters:
sourceData –
minSize – float
maxSize – float
Sets the points’ sizes according to a passed list of values. Values from sourceData
are sorted and mapped to a point size which is between minSize
and maxSize
.
Note
If sourceData
length is smaller than number of points in the series, then size of the points at the end of the series will stay the same.
- PySide6.QtCharts.QXYSeries.toggleSelection(indexes)#
- Parameters:
indexes –
Changes selection state of points at given indexes
to the opposite one. Makes