8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
35 Plot(
const ffi::Plot* p) : p_(p) {}
41 std::optional<std::string_view>
title()
const {
42 ffi::PineStringRef ref;
43 if (ffi::plotTitle(p_, &ref)) {
55 std::optional<double>
value(uintptr_t idx)
const {
57 if (ffi::plotValue(p_, idx, &val)) {
70 std::optional<uint32_t>
color(uintptr_t idx)
const {
72 if (ffi::plotColor(p_, idx, &col)) {
82 int32_t
lineWidth()
const {
return ffi::plotLineWidth(p_); }
87 PlotStyle
style()
const {
return ffi::plotStyle(p_); }
92 bool trackPrice()
const {
return ffi::plotTrackPrice(p_); }
97 double histBase()
const {
return ffi::plotHistBase(p_); }
102 int32_t
offset()
const {
return ffi::plotOffset(p_); }
107 bool join()
const {
return ffi::plotJoin(p_); }
112 bool editable()
const {
return ffi::plotEditable(p_); }
119 if (ffi::plotShowLast(p_, &v)) {
134 std::optional<std::string_view>
format()
const {
135 ffi::PineStringRef ref;
136 if (ffi::plotFormat(p_, &ref)) {
148 if (ffi::plotPrecision(p_, &v)) {
163 PlotLineStyle
lineStyle()
const {
return ffi::plotLineStyle(p_); }
A type-safe display bitmask.
std::optional< std::string_view > title() const
Gets the title of the plot.
bool editable() const
Gets whether this plot is user-editable.
PlotLineStyle lineStyle() const
Gets the line style used when drawing line-based plots.
bool join() const
Gets whether this plot joins gaps.
std::optional< uintptr_t > showLast() const
Gets the show_last value, if set.
int32_t offset() const
Gets the bar index offset.
int32_t lineWidth() const
Gets the line width used to render this plot.
std::optional< uint32_t > color(uintptr_t idx) const
Gets the color at the specified index.
double histBase() const
Gets the baseline used by histogram/area fills.
Display display() const
Gets the display mask for this plot.
std::optional< std::string_view > format() const
Gets the optional formatting hint.
std::optional< double > value(uintptr_t idx) const
Gets the series value at the specified index.
PlotStyle style() const
Gets the plot style.
bool forceOverlay() const
Gets whether the plot is forced to render as overlay.
bool trackPrice() const
Gets whether this plot tracks the last value on the price scale.
std::optional< int32_t > precision() const
Gets the optional decimal precision.
Type-safe wrappers for display bitmasks used by visuals.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.