|
QTradingView 1.0.0
A high-performance charting library built with C++ and Qt.
|
Represents a candlestick chart series in QTradingView. More...
#include <CandleStickSeries.h>
Public Member Functions | |
| CandleStickSeries (const QList< CandleStick > &data) | |
| Constructs a CandleStickSeries with initial data. | |
| ~CandleStickSeries () override | |
| Destroys the CandleStickSeries object. | |
| void | setData (const QList< CandleStick > &data={}) |
| Sets the candlestick data for the series. | |
| const QList< CandleStick > & | data () const |
| Returns the current candlestick data. | |
| qint64 | timestampAt (int index) const override |
| Returns the timestamp for the candlestick at the given index. | |
| int | dataCount () const override |
| Returns the number of candlesticks in the series. | |
| void | setBullColor (const QColor &color) |
| Sets the color for bullish candles. | |
| void | setBearColor (const QColor &color) |
| Sets the color for bearish candles. | |
| void | setBorderColor (const QColor &color) |
| Sets the border color for candles. | |
| void | setBorderWidth (double width) |
| Sets the border width for candles. | |
| void | setBodyWithRatio (double ratio) |
| Sets the body width ratio for candles. | |
| void | setMaxBodyWidth (double maxWidth) |
| Sets the maximum body width for candles. | |
| void | setAntialiasing (bool enabled) |
| Enables or disables antialiasing for the series. | |
| void | render (QPainter *painter, const ViewPort &viewport, IScale *scale) override |
| Renders the series within the given viewport and scale. | |
| bool | hitTest (const QPointF &point, int &outIndex) const override |
| Performs hit testing to find the nearest data point to the given position. | |
| void | calculateRange (int startIndex, int endIndex, double &outMin, double &outMax) const override |
| Calculates the data range (min/max values) within the given index range. | |
Public Member Functions inherited from QTradingView::Series | |
| Series (SeriesType type) | |
| Constructs a Series of the given type. | |
| virtual | ~Series ()=default |
| Virtual destructor for Series. | |
| SeriesType | type () const |
| Returns the type of the series. | |
Additional Inherited Members | |
Protected Attributes inherited from QTradingView::Series | |
| SeriesType | m_type |
Represents a candlestick chart series in QTradingView.
CandleStickSeries manages a collection of candlestick data and renders them as a candlestick chart. Supports data updates and style customization.
|
explicit |
Constructs a CandleStickSeries with initial data.
| data | List of CandleStick objects. |
|
overridevirtual |
Calculates the data range (min/max values) within the given index range.
| startIndex | Start index of the range. |
| endIndex | End index of the range. |
| outMin | Output parameter for the minimum value. |
| outMax | Output parameter for the maximum value. |
Implements QTradingView::Series.
| const QList< CandleStick > & QTradingView::CandleStickSeries::data | ( | ) | const |
Returns the current candlestick data.
|
overridevirtual |
Returns the number of candlesticks in the series.
Implements QTradingView::Series.
|
overridevirtual |
Performs hit testing to find the nearest data point to the given position.
| point | Position to test. |
| outIndex | Output parameter for the nearest data point index. |
Implements QTradingView::Series.
|
overridevirtual |
Renders the series within the given viewport and scale.
| painter | QPainter instance for drawing. |
| viewport | Viewport defining the area to render. |
| scale | Scale used for rendering. |
Implements QTradingView::Series.
| void QTradingView::CandleStickSeries::setAntialiasing | ( | bool | enabled | ) |
Enables or disables antialiasing for the series.
| enabled | Antialiasing flag. |
| void QTradingView::CandleStickSeries::setBearColor | ( | const QColor & | color | ) |
Sets the color for bearish candles.
| color | Bearish candle color. |
| void QTradingView::CandleStickSeries::setBodyWithRatio | ( | double | ratio | ) |
Sets the body width ratio for candles.
| ratio | Ratio of body width to total width. |
| void QTradingView::CandleStickSeries::setBorderColor | ( | const QColor & | color | ) |
Sets the border color for candles.
| color | Border color. |
| void QTradingView::CandleStickSeries::setBorderWidth | ( | double | width | ) |
Sets the border width for candles.
| width | Border width in pixels. |
| void QTradingView::CandleStickSeries::setBullColor | ( | const QColor & | color | ) |
Sets the color for bullish candles.
| color | Bullish candle color. |
| void QTradingView::CandleStickSeries::setData | ( | const QList< CandleStick > & | data = {} | ) |
Sets the candlestick data for the series.
| data | List of CandleStick objects. |
| void QTradingView::CandleStickSeries::setMaxBodyWidth | ( | double | maxWidth | ) |
Sets the maximum body width for candles.
| maxWidth | Maximum body width in pixels. |
|
overridevirtual |
Returns the timestamp for the candlestick at the given index.
| index | Candlestick index. |
Implements QTradingView::Series.