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

Renders crosshair lines and labels on the chart. More...

#include <CrosshairRenderer.h>

Public Member Functions

 CrosshairRenderer ()
 Constructs a CrosshairRenderer with default settings.
 
void setCrosshairColor (const QColor &color)
 Sets the color of the crosshair lines.
 
void setLabelBackgroundColor (const QColor &color)
 Sets the background color of the crosshair label.
 
void setLabelTextColor (const QColor &color)
 Sets the text color of the crosshair label.
 
void setFont (const QFont &font)
 Sets the font used for crosshair labels.
 
void render (QPainter *painter, const QPointF &position, const ViewPort &viewport, const Pane *pane, const Series *series, double xAxisY=-1.0)
 Renders the crosshair and its labels on the chart.
 

Detailed Description

Renders crosshair lines and labels on the chart.

CrosshairRenderer draws vertical and horizontal crosshair lines at the mouse position, along with price and time labels. It supports customization of colors and fonts for the crosshair and labels.

Member Function Documentation

◆ render()

void QTradingView::CrosshairRenderer::render ( QPainter *  painter,
const QPointF &  position,
const ViewPort viewport,
const Pane pane,
const Series series,
double  xAxisY = -1.0 
)

Renders the crosshair and its labels on the chart.

Parameters
painterThe QPainter instance used for drawing.
positionThe position of the crosshair.
viewportThe current viewport settings.
paneThe pane being rendered.
seriesThe data series being displayed.
xAxisYOptional Y position for the X-axis (default -1.0).

◆ setCrosshairColor()

void QTradingView::CrosshairRenderer::setCrosshairColor ( const QColor &  color)

Sets the color of the crosshair lines.

Parameters
colorThe crosshair color.

◆ setFont()

void QTradingView::CrosshairRenderer::setFont ( const QFont &  font)

Sets the font used for crosshair labels.

Parameters
fontThe label font.

◆ setLabelBackgroundColor()

void QTradingView::CrosshairRenderer::setLabelBackgroundColor ( const QColor &  color)

Sets the background color of the crosshair label.

Parameters
colorThe label background color.

◆ setLabelTextColor()

void QTradingView::CrosshairRenderer::setLabelTextColor ( const QColor &  color)

Sets the text color of the crosshair label.

Parameters
colorThe label text color.

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