- class QCandlestickSeries#
The
QCandlestickSeries
class presents data as candlesticks. More…Synopsis#
Properties#
bodyOutlineVisibleᅟ
- Visibility of the candlestick body outlinebodyWidthᅟ
- Relative width of the candlestick item within its own slot, in the range from 0.0 to 1.0brushᅟ
- Used to fill the candlestick itemscapsVisibleᅟ
- Visibility of the capscapsWidthᅟ
- Relative width of the caps within a candlestick, in the range from 0.0 to 1.0countᅟ
- Number of candlestick items in a seriesdecreasingColorᅟ
- Color of the decreasing candlestick item bodyincreasingColorᅟ
- Color of the increasing candlestick item bodymaximumColumnWidthᅟ
- Maximum width of the candlestick items in pixels. Setting a negative value means there is no maximum width. All negative values are converted to -1.0minimumColumnWidthᅟ
- Minimum width of the candlestick items in pixels. Setting a negative value means there is no minimum width. All negative values are converted to -1.0penᅟ
- Used to draw the lines of the candlestick items
Methods#
def
__init__()
def
append()
def
bodyWidth()
def
brush()
def
capsVisible()
def
capsWidth()
def
clear()
def
count()
def
insert()
def
pen()
def
remove()
def
setBodyWidth()
def
setBrush()
def
setCapsVisible()
def
setCapsWidth()
def
setPen()
def
sets()
def
take()
Signals#
def
brushChanged()
def
clicked()
def
countChanged()
def
doubleClicked()
def
hovered()
def
penChanged()
def
pressed()
def
released()
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#
This class acts as a container for single candlestick items. Each item is drawn to its own category when using
QBarCategoryAxis
.QDateTimeAxis
andQValueAxis
can be used as alternatives toQBarCategoryAxis
. In this case, each candlestick item is drawn according to its timestamp value.Note
The timestamps must be unique within a
QCandlestickSeries
. When usingQBarCategoryAxis
, only the first one of the candlestick items sharing a timestamp is drawn. If the chart includes multiple instances ofQCandlestickSeries
, items from different series sharing a timestamp are drawn to the same category. When usingQValueAxis
orQDateTimeAxis
, candlestick items sharing a timestamp will overlap each other.See the Charts with Widgets Gallery to learn how to create a candlestick chart.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property bodyOutlineVisibleᅟ: bool#
This property holds The visibility of the candlestick body outline..
- Access functions:
- property bodyWidthᅟ: float#
This property holds The relative width of the candlestick item within its own slot, in the range from 0.0 to 1.0..
Values outside this range are clamped to 0.0 or 1.0.
- Access functions:
This property holds The brush used to fill the candlestick items..
- Access functions:
Signal
brushChanged()
- property capsVisibleᅟ: bool#
This property holds The visibility of the caps..
- Access functions:
- property capsWidthᅟ: float#
This property holds The relative width of the caps within a candlestick, in the range from 0.0 to 1.0..
Values outside this range are clamped to 0.0 or 1.0.
- Access functions:
- property countᅟ: int#
This property holds The number of candlestick items in a series..
- Access functions:
Signal
countChanged()
This property holds The color of the decreasing candlestick item body..
A candlestick is decreasing when its open value is higher than the close value. By default, this property is set to the brush color with the alpha channel set to 128. The default color is used also when the property is set to an invalid color value.
- Access functions:
This property holds The color of the increasing candlestick item body..
A candlestick is increasing when its close value is higher than the open value. By default, this property is set to the brush color. The default color is used also when the property is set to an invalid color value.
- Access functions:
- property maximumColumnWidthᅟ: float#
This property holds The maximum width of the candlestick items in pixels. Setting a negative value means there is no maximum width. All negative values are converted to -1.0..
- Access functions:
- property minimumColumnWidthᅟ: float#
This property holds The minimum width of the candlestick items in pixels. Setting a negative value means there is no minimum width. All negative values are converted to -1.0..
- Access functions:
This property holds The pen used to draw the lines of the candlestick items..
- Access functions:
Signal
penChanged()
Constructs an empty
QCandlestickSeries
. Theparent
is optional.- append(set)#
- Parameters:
set –
QCandlestickSet
- Return type:
bool
Adds a single candlestick item specified by
set
to the series and takes ownership of it. If the item is null or it is already in the series, it is not appended. Returnstrue
if appending succeeded,false
otherwise.- append(sets)
- Parameters:
sets – .list of QCandlestickSet
- Return type:
bool
Adds a list of candlestick items specified by
sets
to the series and takes ownership of it. If any of the items are null, already belong to the series, or appear in the list more than once, nothing is appended. Returnstrue
if all items were appended successfully,false
otherwise.- bodyOutlineVisibilityChanged()#
This signal is emitted when the visibility of the candlestick item body outline changes.
See also
Notification signal of property
bodyOutlineVisibleᅟ
.- bodyOutlineVisible()#
- Return type:
bool
See also
Getter of property
bodyOutlineVisibleᅟ
.- bodyWidth()#
- Return type:
float
See also
Getter of property
bodyWidthᅟ
.- bodyWidthChanged()#
This signal is emitted when the candlestick item width changes.
See also
Notification signal of property
bodyWidthᅟ
.- brush()#
- Return type:
See also
Getter of property
brushᅟ
.- brushChanged()#
This signal is emitted when the candlestick item brush changes.
See also
Notification signal of property
brushᅟ
.- candlestickSetsAdded(sets)#
- Parameters:
sets – .list of QCandlestickSet
This signal is emitted when the candlestick items specified by
sets
are added to the series.- candlestickSetsRemoved(sets)#
- Parameters:
sets – .list of QCandlestickSet
This signal is emitted when the candlestick items specified by
sets
are removed from the series.- capsVisibilityChanged()#
This signal is emitted when the visibility of the candlestick item caps changes.
See also
Notification signal of property
capsVisibleᅟ
.- capsVisible()#
- Return type:
bool
See also
Getter of property
capsVisibleᅟ
.- capsWidth()#
- Return type:
float
See also
Getter of property
capsWidthᅟ
.- capsWidthChanged()#
This signal is emitted when the candlestick item caps width changes.
See also
Notification signal of property
capsWidthᅟ
.- clear()#
Removes all candlestick items from the series and permanently deletes them.
- clicked(set)#
- Parameters:
set –
QCandlestickSet
This signal is emitted when the candlestick item specified by
set
is clicked on the chart.- count()#
- Return type:
int
Returns the number of the candlestick items in the series.
Getter of property
countᅟ
.- countChanged()#
This signal is emitted when the number of candlestick items in the series changes.
See also
Notification signal of property
countᅟ
.- decreasingColor()#
- Return type:
See also
Getter of property
decreasingColorᅟ
.- decreasingColorChanged()#
This signal is emitted when the candlestick item decreasing color changes.
See also
Notification signal of property
decreasingColorᅟ
.- doubleClicked(set)#
- Parameters:
set –
QCandlestickSet
This signal is emitted when the candlestick item specified by
set
is double-clicked on the chart.- hovered(status, set)#
- Parameters:
status – bool
set –
QCandlestickSet
This signal is emitted when a mouse is hovered over the candlestick item specified by
set
in a chart.When the mouse moves over the item,
status
turnstrue
, and when the mouse moves away again, it turnsfalse
.- increasingColor()#
- Return type:
See also
Getter of property
increasingColorᅟ
.- increasingColorChanged()#
This signal is emitted when the candlestick item increasing color changes.
See also
Notification signal of property
increasingColorᅟ
.- insert(index, set)#
- Parameters:
index – int
set –
QCandlestickSet
- Return type:
bool
Inserts the candlestick item specified by
set
to the series at the position specified byindex
. Takes ownership of the item. If the item is null or already belongs to the series, it is not inserted. Returnstrue
if inserting succeeded,false
otherwise.- maximumColumnWidth()#
- Return type:
float
See also
Getter of property
maximumColumnWidthᅟ
.- maximumColumnWidthChanged()#
This signal is emitted when there is a change in the maximum column width of candlestick items.
See also
Notification signal of property
maximumColumnWidthᅟ
.- minimumColumnWidth()#
- Return type:
float
See also
Getter of property
minimumColumnWidthᅟ
.- minimumColumnWidthChanged()#
This signal is emitted when there is a change in the minimum column width of candlestick items.
See also
Notification signal of property
minimumColumnWidthᅟ
.Getter of property
penᅟ
.- penChanged()#
This signal is emitted when the candlestick item pen changes.
See also
Notification signal of property
penᅟ
.- pressed(set)#
- Parameters:
set –
QCandlestickSet
This signal is emitted when the user clicks the candlestick item specified by
set
and holds down the mouse button.- released(set)#
- Parameters:
set –
QCandlestickSet
This signal is emitted when the user releases the mouse press on the candlestick item specified by
set
.- remove(set)#
- Parameters:
set –
QCandlestickSet
- Return type:
bool
Removes a single candlestick item, specified by
set
, from the series. Returnstrue
if the item is successfully deleted,false
otherwise.- remove(sets)
- Parameters:
sets – .list of QCandlestickSet
- Return type:
bool
Removes a list of candlestick items specified by
sets
from the series. If any of the items are null, were already removed from the series, or appear in the list more than once, nothing is removed. Returnstrue
if all items were removed successfully,false
otherwise.- setBodyOutlineVisible(bodyOutlineVisible)#
- Parameters:
bodyOutlineVisible – bool
See also
Setter of property
bodyOutlineVisibleᅟ
.- setBodyWidth(bodyWidth)#
- Parameters:
bodyWidth – float
See also
Setter of property
bodyWidthᅟ
.Setter of property
brushᅟ
.- setCapsVisible(capsVisible)#
- Parameters:
capsVisible – bool
See also
Setter of property
capsVisibleᅟ
.- setCapsWidth(capsWidth)#
- Parameters:
capsWidth – float
See also
Setter of property
capsWidthᅟ
.Setter of property
decreasingColorᅟ
.Setter of property
increasingColorᅟ
.- setMaximumColumnWidth(maximumColumnWidth)#
- Parameters:
maximumColumnWidth – float
See also
Setter of property
maximumColumnWidthᅟ
.- setMinimumColumnWidth(minimumColumnWidth)#
- Parameters:
minimumColumnWidth – float
See also
Setter of property
minimumColumnWidthᅟ
.Setter of property
penᅟ
.- sets()#
- Return type:
.list of QCandlestickSet
Returns the list of candlestick items in the series. Ownership of the items does not change.
- take(set)#
- Parameters:
set –
QCandlestickSet
- Return type:
bool
Takes a single candlestick item, specified by
set
, from the series. Does not delete the item. Returnstrue
if the take operation was successful,false
otherwise.Note
The series remains the item’s parent object. You must set the parent object to take full ownership.