Represents a bar chart series in QTradingView.
More...
#include <BarSeries.h>
|
| | BarSeries (const QList< DataPoint > &data={}) |
| | Constructs a BarSeries with optional initial data.
|
| |
|
| ~BarSeries () override |
| | Destroys the BarSeries object.
|
| |
| void | setData (const QList< DataPoint > &data) |
| | Sets the bar data for the series.
|
| |
| const QList< DataPoint > & | data () const |
| | Returns the current bar data.
|
| |
| qint64 | timestampAt (int index) const override |
| | Returns the timestamp for the bar at the given index.
|
| |
| int | dataCount () const override |
| | Returns the number of bars in the series.
|
| |
| void | setUpColor (const QColor &color) |
| | Sets the color for upward bars.
|
| |
| void | setDownColor (const QColor &color) |
| | Sets the color for downward bars.
|
| |
| void | setBarWidthRatio (double ratio) |
| | Sets the width ratio for bars.
|
| |
| void | setLineWidth (double width) |
| | Sets the line width for the bars.
|
| |
| void | setAntialiasing (bool enabled) |
| | Enables or disables antialiasing for bar rendering.
|
| |
| 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.
|
| |
| | 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.
|
| |
Represents a bar chart series in QTradingView.
BarSeries manages a collection of bar data and renders them as a bar chart. Supports data updates and style customization.
◆ BarSeries()
| QTradingView::BarSeries::BarSeries |
( |
const QList< DataPoint > & |
data = {} | ) |
|
|
explicit |
Constructs a BarSeries with optional initial data.
- Parameters
-
◆ calculateRange()
| void QTradingView::BarSeries::calculateRange |
( |
int |
startIndex, |
|
|
int |
endIndex, |
|
|
double & |
outMin, |
|
|
double & |
outMax |
|
) |
| const |
|
overridevirtual |
Calculates the data range (min/max values) within the given index range.
- Parameters
-
| 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.
◆ data()
| const QList< DataPoint > & QTradingView::BarSeries::data |
( |
| ) |
const |
Returns the current bar data.
- Returns
- List of DataPoint objects.
◆ dataCount()
| int QTradingView::BarSeries::dataCount |
( |
| ) |
const |
|
overridevirtual |
◆ hitTest()
| bool QTradingView::BarSeries::hitTest |
( |
const QPointF & |
point, |
|
|
int & |
outIndex |
|
) |
| const |
|
overridevirtual |
Performs hit testing to find the nearest data point to the given position.
- Parameters
-
| point | Position to test. |
| outIndex | Output parameter for the nearest data point index. |
- Returns
- True if a data point was hit, false otherwise.
Implements QTradingView::Series.
◆ render()
| void QTradingView::BarSeries::render |
( |
QPainter * |
painter, |
|
|
const ViewPort & |
viewport, |
|
|
IScale * |
scale |
|
) |
| |
|
overridevirtual |
Renders the series within the given viewport and scale.
- Parameters
-
| painter | QPainter instance for drawing. |
| viewport | Viewport defining the area to render. |
| scale | Scale used for rendering. |
Implements QTradingView::Series.
◆ setAntialiasing()
| void QTradingView::BarSeries::setAntialiasing |
( |
bool |
enabled | ) |
|
Enables or disables antialiasing for bar rendering.
- Parameters
-
| enabled | Antialiasing flag. |
◆ setBarWidthRatio()
| void QTradingView::BarSeries::setBarWidthRatio |
( |
double |
ratio | ) |
|
Sets the width ratio for bars.
- Parameters
-
| ratio | Ratio of bar width to total width. |
◆ setData()
| void QTradingView::BarSeries::setData |
( |
const QList< DataPoint > & |
data | ) |
|
Sets the bar data for the series.
- Parameters
-
◆ setDownColor()
| void QTradingView::BarSeries::setDownColor |
( |
const QColor & |
color | ) |
|
Sets the color for downward bars.
- Parameters
-
◆ setLineWidth()
| void QTradingView::BarSeries::setLineWidth |
( |
double |
width | ) |
|
Sets the line width for the bars.
- Parameters
-
| width | Line width in pixels. |
◆ setUpColor()
| void QTradingView::BarSeries::setUpColor |
( |
const QColor & |
color | ) |
|
Sets the color for upward bars.
- Parameters
-
◆ timestampAt()
| qint64 QTradingView::BarSeries::timestampAt |
( |
int |
index | ) |
const |
|
overridevirtual |
Returns the timestamp for the bar at the given index.
- Parameters
-
- Returns
- Timestamp in milliseconds.
Implements QTradingView::Series.
The documentation for this class was generated from the following files:
- include/QTradingView/series/BarSeries.h
- src/series/BarSeries.cpp