|
| | Chart (QWidget *parent=nullptr) |
| | Constructs a Chart object.
|
| |
|
| ~Chart () override |
| | Destroys the Chart object.
|
| |
| std::shared_ptr< Pane > | addPane (double heightRatio=1.0) |
| | Adds a new pane to the chart.
|
| |
| void | removePane (Pane *pane) |
| | Removes a pane from the chart.
|
| |
| Pane * | mainPane () |
| | Returns the main (first) pane of the chart.
|
| |
| std::vector< Pane * > | panes () const |
| | Returns all the panes in the chart.
|
| |
| ViewPort & | viewport () |
| | Access the chart's viewport.
|
| |
| void | setTheme (const ChartTheme &theme) |
| | Sets the chart theme.
|
| |
| const ChartTheme & | theme () const |
| | Gets the current chart theme.
|
| |
|
void | calculateLayout () |
| | Recalculates the layout of all panes and axes based on the current chart size.
|
| |
| void | pan (int indexDelta) |
| | Pans the chart horizontally by a number of data points.
|
| |
| void | zoom (int indexDelta, int anchorIndex) |
| | Zooms the chart horizontally by changing the number of visible data points.
|
| |
|
void | fitToData () |
| | Fits the chart view to show all available data, capped by the maximum allowed bars.
|
| |
| void | showLastNPoints (int n) |
| | Shows the last N data points in the main pane, capped by the maximum allowed bars.
|
| |
|
void | show () |
| | Shows the chart with the default number of data points (e.g., last 300).
|
| |
| void | setCrosshairVisible (bool visible) |
| | Sets the crosshair visibility.
|
| |
| bool | isCrosshairVisible () const |
| | Checks if the crosshair is currently visible.
|
| |
| void | setCrosshairPosition (const QPointF &position) |
| | Sets the crosshair position in chart coordinates.
|
| |
| QPointF | crosshairPosition () const |
| | Gets the current crosshair position in chart coordinates.
|
| |
| AxisRenderer & | axis () |
| | Access the axis renderer for customization.
|
| |
| GridRenderer & | grid () |
| | Access the grid renderer for customization.
|
| |
| CrosshairRenderer & | crosshair () |
| | Access the crosshair renderer for customization.
|
| |
|
|
void | paintEvent (QPaintEvent *event) override |
| |
|
void | resizeEvent (QResizeEvent *event) override |
| |
|
void | wheelEvent (QWheelEvent *event) override |
| |
|
void | mousePressEvent (QMouseEvent *event) override |
| |
|
void | mouseMoveEvent (QMouseEvent *event) override |
| |
|
void | mouseReleaseEvent (QMouseEvent *event) override |
| |
|
void | mouseDoubleClickEvent (QMouseEvent *event) override |
| |
|
void | leaveEvent (QEvent *event) override |
| |
|
bool | event (QEvent *event) override |
| |
|
void | keyPressEvent (QKeyEvent *event) override |
| |
Top level chart container for QTradingView.
The Chart class manages multiple panes, handles zoom/pan interactions, crosshair rendering, and coordinate all series rendering. It provides a high-performance, interactive charting experience similar to TradingView lightweight charts.
QApplication app(argc, argv);
auto pane = chart->addPane(1.0);
pane->addSeries(std::make_shared<QTradingView::CandleStickSeries>(data));
chart->show();
app.exec();
Top level chart container for QTradingView.
Definition Chart.h:74