QTradingView 1.0.0
A high-performance charting library built with C++ and Qt.
Loading...
Searching...
No Matches
QTradingView::Series Class Referenceabstract

Abstract base class for data series in QTradingView charts. More...

#include <Series.h>

Inheritance diagram for QTradingView::Series:
QTradingView::BarSeries QTradingView::CandleStickSeries QTradingView::LineSeries

Public Member Functions

 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.
 
virtual qint64 timestampAt (int index) const =0
 Returns the timestamp for the data point at the given index.
 
virtual int dataCount () const =0
 Returns the number of data points in the series.
 
virtual void render (QPainter *painter, const ViewPort &viewport, IScale *scale)=0
 Renders the series within the given viewport and scale.
 
virtual bool hitTest (const QPointF &point, int &outIndex) const =0
 Performs hit testing to find the nearest data point to the given position.
 
virtual void calculateRange (int startIndex, int endIndex, double &outMin, double &outMax) const =0
 Calculates the data range (min/max values) within the given index range.
 

Protected Attributes

SeriesType m_type
 

Detailed Description

Abstract base class for data series in QTradingView charts.

Series provides the interface for chart series (line, bar, candlestick), including type, rendering, and data access.

Constructor & Destructor Documentation

◆ Series()

QTradingView::Series::Series ( SeriesType  type)
inlineexplicit

Constructs a Series of the given type.

Parameters
typeSeries type (Line, Bar, CandleStick).

Member Function Documentation

◆ calculateRange()

virtual void QTradingView::Series::calculateRange ( int  startIndex,
int  endIndex,
double &  outMin,
double &  outMax 
) const
pure virtual

Calculates the data range (min/max values) within the given index range.

Parameters
startIndexStart index of the range.
endIndexEnd index of the range.
outMinOutput parameter for the minimum value.
outMaxOutput parameter for the maximum value.

Implemented in QTradingView::BarSeries, QTradingView::CandleStickSeries, and QTradingView::LineSeries.

◆ dataCount()

virtual int QTradingView::Series::dataCount ( ) const
pure virtual

Returns the number of data points in the series.

Returns
Data point count.

Implemented in QTradingView::BarSeries, QTradingView::CandleStickSeries, and QTradingView::LineSeries.

◆ hitTest()

virtual bool QTradingView::Series::hitTest ( const QPointF &  point,
int &  outIndex 
) const
pure virtual

Performs hit testing to find the nearest data point to the given position.

Parameters
pointPosition to test.
outIndexOutput parameter for the nearest data point index.
Returns
True if a data point was hit, false otherwise.

Implemented in QTradingView::BarSeries, QTradingView::CandleStickSeries, and QTradingView::LineSeries.

◆ render()

virtual void QTradingView::Series::render ( QPainter *  painter,
const ViewPort viewport,
IScale scale 
)
pure virtual

Renders the series within the given viewport and scale.

Parameters
painterQPainter instance for drawing.
viewportViewport defining the area to render.
scaleScale used for rendering.

Implemented in QTradingView::BarSeries, QTradingView::CandleStickSeries, and QTradingView::LineSeries.

◆ timestampAt()

virtual qint64 QTradingView::Series::timestampAt ( int  index) const
pure virtual

Returns the timestamp for the data point at the given index.

Parameters
indexData point index.
Returns
Timestamp in milliseconds.

Implemented in QTradingView::BarSeries, QTradingView::CandleStickSeries, and QTradingView::LineSeries.

◆ type()

SeriesType QTradingView::Series::type ( ) const

Returns the type of the series.

Returns
SeriesType enum value.

The documentation for this class was generated from the following file: