OpenPine C++ API
C++ wrapper for the OpenPine Pine Script VM
Loading...
Searching...
No Matches
openpine::SeriesGraph Class Reference

Represents a series graph in a chart. More...

#include <series_graph.hpp>

Public Member Functions

 SeriesGraph (const ffi::SeriesGraph *p)
 Constructs a wrapper around the given series graph pointer.
SeriesGraphType type () const
 Gets the type of the series graph.
std::optional< seriesgraph::PlotasPlot () const
 Gets the plot associated with this graph, if any.
std::optional< seriesgraph::BackgroundColorsasBackgroundColors () const
 Gets the background-colors associated with this graph, if any.
std::optional< seriesgraph::FillasFill () const
 Gets the fill associated with this graph, if any.
std::optional< seriesgraph::PlotArrowasPlotArrow () const
 Gets the plot-arrow associated with this graph, if any.
std::optional< seriesgraph::PlotBarasPlotBar () const
 Gets the plot-bar associated with this graph, if any.
std::optional< seriesgraph::PlotCandleasPlotCandle () const
 Gets the plot-candle associated with this graph, if any.
std::optional< seriesgraph::PlotCharasPlotChar () const
 Gets the plot-char associated with this graph, if any.
std::optional< seriesgraph::PlotShapeasPlotShape () const
 Gets the plot-shape associated with this graph, if any.

Detailed Description

Represents a series graph in a chart.

A SeriesGraph is a tagged union of several draw/plot-like outputs. Use type() to inspect the concrete kind and then query the appropriate accessor.

Definition at line 37 of file series_graph.hpp.

Constructor & Destructor Documentation

◆ SeriesGraph()

openpine::SeriesGraph::SeriesGraph ( const ffi::SeriesGraph * p)
inline

Constructs a wrapper around the given series graph pointer.

Definition at line 43 of file series_graph.hpp.

Member Function Documentation

◆ asBackgroundColors()

std::optional< seriesgraph::BackgroundColors > openpine::SeriesGraph::asBackgroundColors ( ) const
inline

Gets the background-colors associated with this graph, if any.

Returns
A seriesgraph::BackgroundColors when type() == SeriesGraphType::BackgroundColors, otherwise std::nullopt.

Definition at line 70 of file series_graph.hpp.

◆ asFill()

std::optional< seriesgraph::Fill > openpine::SeriesGraph::asFill ( ) const
inline

Gets the fill associated with this graph, if any.

Returns
A seriesgraph::Fill when type() == SeriesGraphType::Fill, otherwise std::nullopt.

Definition at line 84 of file series_graph.hpp.

◆ asPlot()

std::optional< seriesgraph::Plot > openpine::SeriesGraph::asPlot ( ) const
inline

Gets the plot associated with this graph, if any.

Returns
A seriesgraph::Plot when type() == SeriesGraphType::Plot, otherwise std::nullopt.

Definition at line 56 of file series_graph.hpp.

◆ asPlotArrow()

std::optional< seriesgraph::PlotArrow > openpine::SeriesGraph::asPlotArrow ( ) const
inline

Gets the plot-arrow associated with this graph, if any.

Returns
A seriesgraph::PlotArrow when type() == SeriesGraphType::PlotArrow, otherwise std::nullopt.

Definition at line 98 of file series_graph.hpp.

◆ asPlotBar()

std::optional< seriesgraph::PlotBar > openpine::SeriesGraph::asPlotBar ( ) const
inline

Gets the plot-bar associated with this graph, if any.

Returns
A seriesgraph::PlotBar when type() == SeriesGraphType::PlotBar, otherwise std::nullopt.

Definition at line 112 of file series_graph.hpp.

◆ asPlotCandle()

std::optional< seriesgraph::PlotCandle > openpine::SeriesGraph::asPlotCandle ( ) const
inline

Gets the plot-candle associated with this graph, if any.

Returns
A seriesgraph::PlotCandle when type() == SeriesGraphType::PlotCandle, otherwise std::nullopt.

Definition at line 126 of file series_graph.hpp.

◆ asPlotChar()

std::optional< seriesgraph::PlotChar > openpine::SeriesGraph::asPlotChar ( ) const
inline

Gets the plot-char associated with this graph, if any.

Returns
A seriesgraph::PlotChar when type() == SeriesGraphType::PlotChar, otherwise std::nullopt.

Definition at line 140 of file series_graph.hpp.

◆ asPlotShape()

std::optional< seriesgraph::PlotShape > openpine::SeriesGraph::asPlotShape ( ) const
inline

Gets the plot-shape associated with this graph, if any.

Returns
A seriesgraph::PlotShape when type() == SeriesGraphType::PlotShape, otherwise std::nullopt.

Definition at line 154 of file series_graph.hpp.

◆ type()

SeriesGraphType openpine::SeriesGraph::type ( ) const
inline

Gets the type of the series graph.

Returns
The graph type tag.

Definition at line 49 of file series_graph.hpp.


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