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

Represents a plot graph in a chart. More...

#include <plot.hpp>

Public Member Functions

 Plot (const ffi::Plot *p)
std::optional< std::string_view > title () const
 Gets the title of the plot.
std::optional< double > value (uintptr_t idx) const
 Gets the series value at the specified index.
std::optional< uint32_t > color (uintptr_t idx) const
 Gets the color at the specified index.
int32_t lineWidth () const
 Gets the line width used to render this plot.
PlotStyle style () const
 Gets the plot style.
bool trackPrice () const
 Gets whether this plot tracks the last value on the price scale.
double histBase () const
 Gets the baseline used by histogram/area fills.
int32_t offset () const
 Gets the bar index offset.
bool join () const
 Gets whether this plot joins gaps.
bool editable () const
 Gets whether this plot is user-editable.
std::optional< uintptr_t > showLast () const
 Gets the show_last value, if set.
Display display () const
 Gets the display mask for this plot.
std::optional< std::string_view > format () const
 Gets the optional formatting hint.
std::optional< int32_t > precision () const
 Gets the optional decimal precision.
bool forceOverlay () const
 Gets whether the plot is forced to render as overlay.
PlotLineStyle lineStyle () const
 Gets the line style used when drawing line-based plots.

Detailed Description

Represents a plot graph in a chart.

A Plot exposes per-bar series values and optional per-bar colors.

Definition at line 30 of file plot.hpp.

Constructor & Destructor Documentation

◆ Plot()

openpine::seriesgraph::Plot::Plot ( const ffi::Plot * p)
inline

Definition at line 35 of file plot.hpp.

Member Function Documentation

◆ color()

std::optional< uint32_t > openpine::seriesgraph::Plot::color ( uintptr_t idx) const
inline

Gets the color at the specified index.

Parameters
idxThe bar index.
Returns
The color value (format defined by the ABI) if available, otherwise std::nullopt.

Definition at line 70 of file plot.hpp.

◆ display()

Display openpine::seriesgraph::Plot::display ( ) const
inline

Gets the display mask for this plot.

Definition at line 129 of file plot.hpp.

◆ editable()

bool openpine::seriesgraph::Plot::editable ( ) const
inline

Gets whether this plot is user-editable.

Definition at line 112 of file plot.hpp.

◆ forceOverlay()

bool openpine::seriesgraph::Plot::forceOverlay ( ) const
inline

Gets whether the plot is forced to render as overlay.

Definition at line 158 of file plot.hpp.

◆ format()

std::optional< std::string_view > openpine::seriesgraph::Plot::format ( ) const
inline

Gets the optional formatting hint.

Definition at line 134 of file plot.hpp.

References openpine::detail::refToView().

◆ histBase()

double openpine::seriesgraph::Plot::histBase ( ) const
inline

Gets the baseline used by histogram/area fills.

Definition at line 97 of file plot.hpp.

◆ join()

bool openpine::seriesgraph::Plot::join ( ) const
inline

Gets whether this plot joins gaps.

Definition at line 107 of file plot.hpp.

◆ lineStyle()

PlotLineStyle openpine::seriesgraph::Plot::lineStyle ( ) const
inline

Gets the line style used when drawing line-based plots.

Definition at line 163 of file plot.hpp.

◆ lineWidth()

int32_t openpine::seriesgraph::Plot::lineWidth ( ) const
inline

Gets the line width used to render this plot.

Definition at line 82 of file plot.hpp.

◆ offset()

int32_t openpine::seriesgraph::Plot::offset ( ) const
inline

Gets the bar index offset.

Definition at line 102 of file plot.hpp.

◆ precision()

std::optional< int32_t > openpine::seriesgraph::Plot::precision ( ) const
inline

Gets the optional decimal precision.

Definition at line 146 of file plot.hpp.

◆ showLast()

std::optional< uintptr_t > openpine::seriesgraph::Plot::showLast ( ) const
inline

Gets the show_last value, if set.

Definition at line 117 of file plot.hpp.

◆ style()

PlotStyle openpine::seriesgraph::Plot::style ( ) const
inline

Gets the plot style.

Definition at line 87 of file plot.hpp.

◆ title()

std::optional< std::string_view > openpine::seriesgraph::Plot::title ( ) const
inline

Gets the title of the plot.

Returns
The title if available, otherwise std::nullopt.

Definition at line 41 of file plot.hpp.

References openpine::detail::refToView().

◆ trackPrice()

bool openpine::seriesgraph::Plot::trackPrice ( ) const
inline

Gets whether this plot tracks the last value on the price scale.

Definition at line 92 of file plot.hpp.

◆ value()

std::optional< double > openpine::seriesgraph::Plot::value ( uintptr_t idx) const
inline

Gets the series value at the specified index.

Parameters
idxThe bar index.
Returns
The value if available (not na), otherwise std::nullopt.

Definition at line 55 of file plot.hpp.


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