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

Represents a line chart series in QTradingView. More...

#include <LineSeries.h>

Inheritance diagram for QTradingView::LineSeries:
QTradingView::Series

Public Member Functions

 LineSeries (const QList< DataPoint > &data={})
 Constructs a LineSeries with optional initial data.
 
 ~LineSeries () override
 Destroys the LineSeries object.
 
void setData (const QList< DataPoint > &data)
 Sets the data points for the series.
 
const QList< DataPoint > & data () const
 Returns the current data points.
 
qint64 timestampAt (int index) const override
 Returns the timestamp for the data point at the given index.
 
int dataCount () const override
 Returns the number of data points in the series.
 
void setColor (const QColor &color)
 
void setLineWidth (double width)
 
void setLineStyle (Qt::PenStyle style)
 
void setAntialiasing (bool enabled)
 
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
 

Detailed Description

Represents a line chart series in QTradingView.

LineSeries manages a collection of data points and renders them as a line chart. Supports data updates and style customization.

Constructor & Destructor Documentation

◆ LineSeries()

QTradingView::LineSeries::LineSeries ( const QList< DataPoint > &  data = {})
explicit

Constructs a LineSeries with optional initial data.

Parameters
dataList of DataPoint objects.

Member Function Documentation

◆ calculateRange()

void QTradingView::LineSeries::calculateRange ( int  startIndex,
int  endIndex,
double &  outMin,
double &  outMax 
) const
overridevirtual

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.

Implements QTradingView::Series.

◆ data()

const QList< DataPoint > & QTradingView::LineSeries::data ( ) const

Returns the current data points.

Returns
List of DataPoint objects.

◆ dataCount()

int QTradingView::LineSeries::dataCount ( ) const
overridevirtual

Returns the number of data points in the series.

Returns
Data point count.

Implements QTradingView::Series.

◆ hitTest()

bool QTradingView::LineSeries::hitTest ( const QPointF &  point,
int &  outIndex 
) const
overridevirtual

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.

Implements QTradingView::Series.

◆ render()

void QTradingView::LineSeries::render ( QPainter *  painter,
const ViewPort viewport,
IScale scale 
)
overridevirtual

Renders the series within the given viewport and scale.

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

Implements QTradingView::Series.

◆ setData()

void QTradingView::LineSeries::setData ( const QList< DataPoint > &  data)

Sets the data points for the series.

Parameters
dataList of DataPoint objects.

◆ timestampAt()

qint64 QTradingView::LineSeries::timestampAt ( int  index) const
overridevirtual

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

Parameters
indexData point index.
Returns
Timestamp in milliseconds.

Implements QTradingView::Series.


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