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

Represents a chart pane that contains one or more data series. More...

#include <Pane.h>

Public Member Functions

 Pane ()
 Constructs an empty Pane.
 
void addSeries (std::shared_ptr< Series > series)
 Adds a data series to the pane.
 
void removeSeries (std::shared_ptr< Series > series)
 Removes a data series from the pane.
 
const std::vector< std::shared_ptr< Series > > & series () const
 Returns the list of data series in the pane.
 
void setScale (ScaleType type)
 Sets the Y-axis scale type for the pane.
 
IScalescale () const
 Returns the current Y-axis scale object.
 
void setHeightRatio (double ratio)
 Sets the height ratio of the pane relative to other panes.
 
double heightRatio () const
 Returns the height ratio of the pane.
 
void setRect (const QRectF &rect)
 Sets the rectangle area for the pane in the chart.
 
QRectF rect () const
 Returns the rectangle area of the pane.
 
void calculateRange (int start, int end)
 Calculates the visible value range for the given data indices.
 
double minValue () const
 Returns the minimum value in the current range.
 
double maxValue () const
 Returns the maximum value in the current range.
 
void setManualRange (double minValue, double maxValue)
 Sets a manual value range for the Y-axis.
 
void zoomYAxis (double zoomFactor, double anchorValue)
 Zooms the Y-axis by a factor, anchored at a specific value.
 
void resetAutoRange ()
 Resets the Y-axis to automatic range calculation.
 
bool isAutoRange () const
 Returns true if the Y-axis is in auto-range mode.
 
void render (QPainter *painter, const ViewPort &viewport)
 Renders the pane and its series using the given painter and viewport.
 

Detailed Description

Represents a chart pane that contains one or more data series.

Pane manages the layout, scaling, and rendering of its series. It supports automatic and manual Y-axis scaling, zooming, and custom height ratios for multi-pane charts.

Member Function Documentation

◆ addSeries()

void QTradingView::Pane::addSeries ( std::shared_ptr< Series series)

Adds a data series to the pane.

Parameters
seriesShared pointer to the Series to add.

◆ calculateRange()

void QTradingView::Pane::calculateRange ( int  start,
int  end 
)

Calculates the visible value range for the given data indices.

Parameters
startStart index of the data range.
endEnd index of the data range.

◆ removeSeries()

void QTradingView::Pane::removeSeries ( std::shared_ptr< Series series)

Removes a data series from the pane.

Parameters
seriesShared pointer to the Series to remove.

◆ render()

void QTradingView::Pane::render ( QPainter *  painter,
const ViewPort viewport 
)

Renders the pane and its series using the given painter and viewport.

Parameters
painterQPainter object for drawing.
viewportThe current viewport.

◆ setHeightRatio()

void QTradingView::Pane::setHeightRatio ( double  ratio)

Sets the height ratio of the pane relative to other panes.

Parameters
ratioThe height ratio (e.g., 1.0 for equal height).

◆ setManualRange()

void QTradingView::Pane::setManualRange ( double  minValue,
double  maxValue 
)

Sets a manual value range for the Y-axis.

Parameters
minValueMinimum value.
maxValueMaximum value.

◆ setRect()

void QTradingView::Pane::setRect ( const QRectF &  rect)

Sets the rectangle area for the pane in the chart.

Parameters
rectThe rectangle area.

◆ setScale()

void QTradingView::Pane::setScale ( ScaleType  type)

Sets the Y-axis scale type for the pane.

Parameters
typeThe scale type (e.g., linear, logarithmic).

◆ zoomYAxis()

void QTradingView::Pane::zoomYAxis ( double  zoomFactor,
double  anchorValue 
)

Zooms the Y-axis by a factor, anchored at a specific value.

Parameters
zoomFactorThe zoom factor (>1 to zoom in, <1 to zoom out).
anchorValueThe value to anchor the zoom operation.

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