QCandlestickSeries Class

The QCandlestickSeries class presents data as candlesticks. More...

Header: #include <QCandlestickSeries>
Since: Qt 5.8
Instantiated By: CandlestickSeries
Inherits: QAbstractSeries

This class was introduced in Qt 5.8.

Properties

Public Functions

bool bodyOutlineVisible() const
qreal bodyWidth() const
QBrush brush() const
bool capsVisible() const
qreal capsWidth() const
int count() const
QColor decreasingColor() const
QColor increasingColor() const
qreal maximumColumnWidth() const
qreal minimumColumnWidth() const
QPen pen() const
void setBodyOutlineVisible(bool bodyOutlineVisible)
void setBodyWidth(qreal bodyWidth)
void setBrush(const QBrush &brush)
void setCapsVisible(bool capsVisible)
void setCapsWidth(qreal capsWidth)
void setDecreasingColor(const QColor &decreasingColor)
void setIncreasingColor(const QColor &increasingColor)
void setMaximumColumnWidth(qreal maximumColumnWidth)
void setMinimumColumnWidth(qreal minimumColumnWidth)
void setPen(const QPen &pen)

Signals

Detailed Description

This class acts as a container for single candlestick items. Each item is drawn to its own category when using QBarCategoryAxis. QDateTimeAxis and QValueAxis can be used as alternatives to QBarCategoryAxis. In this case, each candlestick item is drawn according to its timestamp value.

Note: The timestamps must be unique within a QCandlestickSeries. When using QBarCategoryAxis, only the first one of the candlestick items sharing a timestamp is drawn. If the chart includes multiple instances of QCandlestickSeries, items from different series sharing a timestamp are drawn to the same category. When using QValueAxis or QDateTimeAxis, candlestick items sharing a timestamp will overlap each other.

See the candlestick chart example to learn how to create a candlestick chart.

See also QCandlestickSet, QBarCategoryAxis, QDateTimeAxis, and QValueAxis.

Property Documentation

bodyOutlineVisible : bool

This property holds the visibility of the candlestick body outline.

Access functions:

bool bodyOutlineVisible() const
void setBodyOutlineVisible(bool bodyOutlineVisible)

Notifier signal:

void bodyOutlineVisibilityChanged()

bodyWidth : qreal

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:

qreal bodyWidth() const
void setBodyWidth(qreal bodyWidth)

Notifier signal:

void bodyWidthChanged()

brush : QBrush

This property holds the brush used to fill the candlestick items.

Access functions:

QBrush brush() const
void setBrush(const QBrush &brush)

Notifier signal:

void brushChanged()

capsVisible : bool

This property holds the visibility of the caps.

Access functions:

bool capsVisible() const
void setCapsVisible(bool capsVisible)

Notifier signal:

void capsVisibilityChanged()

capsWidth : qreal

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:

qreal capsWidth() const
void setCapsWidth(qreal capsWidth)

Notifier signal:

void capsWidthChanged()

count : const int

This property holds the number of candlestick items in a series.

Access functions:

int count() const

Notifier signal:

void countChanged()

decreasingColor : QColor

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:

QColor decreasingColor() const
void setDecreasingColor(const QColor &decreasingColor)

Notifier signal:

void decreasingColorChanged()

increasingColor : QColor

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:

QColor increasingColor() const
void setIncreasingColor(const QColor &increasingColor)

Notifier signal:

void increasingColorChanged()

maximumColumnWidth : qreal

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:

qreal maximumColumnWidth() const
void setMaximumColumnWidth(qreal maximumColumnWidth)

Notifier signal:

void maximumColumnWidthChanged()

minimumColumnWidth : qreal

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:

qreal minimumColumnWidth() const
void setMinimumColumnWidth(qreal minimumColumnWidth)

Notifier signal:

void minimumColumnWidthChanged()

pen : QPen

This property holds the pen used to draw the lines of the candlestick items.

Access functions:

QPen pen() const
void setPen(const QPen &pen)

Notifier signal:

void penChanged()