C++ API#
-
struct AxisLabelSettings : public LabelSettingsBase#
- #include <Plotter.h>
Text settings for axis label.
-
struct AxisSettings#
- #include <Plotter.h>
Controls the axis display.
Subclassed by XAxisSettings, YAxisSettings
Public Members
-
int minNumTicks = 6#
Minimum number of ticks that should be displayed.
Should be a multiple of 2. If too close to maxNumTicks, a flickering artifact may be observed.
-
int maxNumTicks = 12#
Maximum number of ticks that should be displayed.
Should be a multiple of 2. If too close to minNumTicks, a flickering artifact may be observed.
-
int initNumTicks = 8#
Initial number of ticks, must be a multiple of two and between min / max num ticks.
-
bool showTicks = true#
If
true, small tick-lines will be displayed.
-
float tickLinewidth = 1.0f#
Width of the tick line.
May have no effect on some GPUs.
-
float tickSize = 0.025f#
Length of the tick line.
-
bool showGridline = true#
If
true, grid lines (that extend the tick line across the plot) are displayed.
-
float gridlineWidth = 0.4f#
Width of the grid line.
May have no effect on some GPUs.
-
float axisLinewidth = 1.0f#
Width of the axis line.
May have no effect on some GPUs.
-
std::optional<int> tickLabelDecimalPlaces = std::nullopt#
Controls the number of decimal places for the y-axis tick labels.
-
std::optional<std::vector<float>> gridlineColor = std::nullopt#
Grid line color, if
std::nulloptuses the default according to ColorMode.
-
std::optional<std::vector<float>> axisColor = std::nullopt#
Axis color, if
std::nulloptuses the default according to ColorMode.
-
std::optional<std::vector<float>> fontColor = std::nullopt#
Axis tick label color, if
std::nulloptuses the default according to ColorMode.
-
int minNumTicks = 6#
-
struct BarSettings#
- #include <Plotter.h>
Settings for a bar plot.
Public Members
-
std::vector<float> color = {8.0 / 255.0, 153.0 / 255.0, 129.0 / 255.0, 1.0f}#
Color of the bar plot.
-
double widthRatio = 0.75#
Ratio between the bar width and inter-bar gap, a double between (0, 1] e.g.
1 is no space between bars.
-
std::optional<float> minValue = std::nullopt#
Minimum value of the bar plot.
By default, the minimum number in
yminus 1% of max y - min y as padding.
-
std::vector<float> color = {8.0 / 255.0, 153.0 / 255.0, 129.0 / 255.0, 1.0f}#
-
struct CameraSettings#
- #include <Plotter.h>
Controls plot pan and zooming.
Public Members
-
double keyZoomSpeed = 2.5#
Controls the speed of zoom by key-press (Q, E, Z, C).
-
double mouseZoomSpeed = 0.012#
Controls the speed of zoom by mouse move (right-click).
-
double keyPanSpeed = 0.35#
Controls the speed of panning by key-press (A, D, W, X).
-
double mousePanSpeed = 0.70#
Controls the speed of panning by mouse move (left-click).
-
double wheelSpeed = 0.002#
Controls the speed of zoom by the mouse wheel.
-
bool lockMostRecentDate = false#
If
true, the axis zoom / pan is locked to the largest x-axis position.
-
bool fixZoomAtEdge = false#
All zooming will be fixed to the y-axis (right or left depending on PlotterArgs.axisRight).
-
double keyZoomSpeed = 2.5#
-
struct CandlestickSettings#
- #include <Plotter.h>
Settings for a candlestick plot.
Public Members
-
std::vector<float> upColor = {8.0 / 255.0, 153.0 / 255.0, 129.0 / 255.0, 1.0}#
Color for candles when close price is higher than open price.
-
std::vector<float> downColor = {244.0 / 255.0, 52.0 / 255.0, 68.0 / 255.0, 1.0}#
Color for candles when close price is lower than open price.
-
CandlestickMode mode = CandlestickMode::full#
Control how candles are displayed.
-
double candleWidthRatio = 0.75#
Ratio between candle and gap width, a float between (0, 1] e.g.
1 is no space between candles.
-
double capWidthRatio = 0.5#
Ratio between candle and cap width, a double between (0, 1] e.g.
1 the cap is the width of the candle.
-
double lineModeLinewidth = 1.0#
Line width for open-line and close-line mode for the candlestick plot.
-
double lineModeMiterLimit = 3.0#
Miter limit controls the maximum line-segment connection length, for open-line and close-line mode.
-
bool lineModeBasicLine = false#
If
true, a simple line plot with fixd width is used (widthandmiterLimithave no effect).This is much faster.
-
std::vector<float> upColor = {8.0 / 255.0, 153.0 / 255.0, 129.0 / 255.0, 1.0}#
-
struct CrosshairSettings#
- #include <Plotter.h>
Settings for the crosshair that follows the mouse over the plot.
Public Members
-
bool on = true#
-
int fontSize = 10#
Point size of the label that appears in the axis.
-
double linewidth = 1.0#
Crosshair line width.
-
std::optional<std::vector<float>> lineColor = std::nullopt#
Crosshair line color.
Default is based on ColorMode.
-
std::optional<std::vector<float>> backgroundColor = std::nullopt#
Background color of the label that appears in the axis.
Default is based on ColorMode.
-
std::optional<std::vector<float>> fontColor = std::nullopt#
Color of the font that appears in the axis.
Default is based on ColorMode.
-
bool on = true#
-
struct HoverValueSettings#
- #include <Plotter.h>
Settings for the pop-up label that appears on mouse hover over plot.
Public Members
-
HoverValueDisplayMode displayMode = HoverValueDisplayMode::alwaysShow#
Display mode (“alwaysShow”, “onlyUnderMouse” (mouse must be over the plot value to show) or “off”).
-
int fontSize = 10#
Point size of the hover label.
-
std::optional<std::vector<float>> fontColor = std::nullopt#
Font color of the hover label.
Default is based on ColorMode.
-
std::optional<std::vector<float>> backgroundColor = std::nullopt#
Background color of the hover label.
Default is based on ColorMode.
-
std::optional<std::vector<float>> borderColor = std::nullopt#
Border color of the hover label.
Default is based on ColorMode.
-
HoverValueDisplayMode displayMode = HoverValueDisplayMode::alwaysShow#
-
struct LabelSettingsBase#
Subclassed by AxisLabelSettings, TitleLabelSettings
-
struct LegendSettings#
- #include <Plotter.h>
Settings for the plot legend.
Public Members
-
float legendSizeScaler = 1.0f#
Simple way to scale the size of the legend.
-
float xBoxPad = 10.0f#
Padding between an outer box and the graph (x dimension).
-
float yBoxPad = 2.0f#
Padding between an outer box and the the graph (y dimension).
-
float lineWidth = 35.0#
Width of the colored line.
-
float lineHeight = 7.5f#
Height of the colored line (that indicates plot color).
-
float xLinePadLeft = 5.0f#
Padding to the left of the colored line.
-
float xLinePadRight = 5.0f#
Padding to the right of the colored line.
-
float xTextPadRight = 2.0f#
Padding to the right of the label text.
-
float yInterItemPad = 5.0f#
Padding between label text elements (y dimension).
-
float yItemPad = 2.0f#
Padding above the first label text.
-
int fontSize = 15#
Point size for the label text.
-
std::optional<std::vector<float>> fontColor = std::nullopt#
Label text font color.
Default is based on ColorMode.
-
std::vector<float> boxColor = {1.0, 1.0, 1.0, 0.0}#
Color of the outer box (by default, invisible).
-
float legendSizeScaler = 1.0f#
-
struct LineSettings#
- #include <Plotter.h>
Settings for a line plot.
Public Members
-
std::vector<float> color = {0.5f, 0.5f, 0.5f, 1.0f}#
Color of the line plot.
-
double width = 0.5#
Line width for the plot.
-
double miterLimit = 3.0#
Miter limit controls the maximum line-segment connection length, for open-line and close-line mode.
-
bool basicLine = false#
If
true, a simple line plot with fixd width is used (widthandmiterLimithave no effect).This is much faster.
-
std::vector<float> color = {0.5f, 0.5f, 0.5f, 1.0f}#
-
class Plotter#
Public Functions
-
Plotter(std::optional<PlotterArgs> plotterArgs = std::nullopt)#
The Plotter class controls all plotting.
- Parameters:
plotterArgs – PlotterArgs struct of options to control the figure.
-
~Plotter()#
-
void start()#
Start the event loop to display and interact with plots.
-
void setBackgroundColor(const std::vector<float> backgroundColor)#
Set the background color for the subplot.
- Parameters:
backgroundColor – Vector of length 1 to 4 setting RGBA color values. Missing values are set to 0.0f for color and 1.0f for alpha. e.g. {0.1f, 0.2f} sets {0.1f, 0.2f, 0.0f, 1.0f}.
-
void setCameraSettings(CameraSettings cameraSettings, std::optional<int> linkedSubplotIdx = std::nullopt)#
Set the camera settings that control pan and zooming.
- Parameters:
cameraSettings – The CameraSettings struct of settings.
linkedSubplotIdx – The linked subplot on which to set the settings. If
nullopt, will be applied to all linked subplots.
-
void setCrosshairSettings(CrosshairSettings crosshairSettings)#
Settings for the crosshair that follows the mouse over the plot.
-
void setDrawLineSettings(DrawLineSettings drawLineSettings)#
Control how lines drawn on the plot are displayed.
-
void setHoverValueSettings(HoverValueSettings hoverValueSettings)#
Control how the pop-up label that appears on mouse hover over plot is displayed.
-
void setXAxisSettings(XAxisSettings xAxisSettings, std::optional<int> linkedSubplotIdx = std::nullopt)#
Control how the x-axis is displayed.
- Parameters:
xAxisSettings – XAxisSettings struct of axis settings.
linkedSubplotIdx – The linked subplot on which to set the settings. If
nullopt, will be applied to all linked subplots.
-
void setYAxisSettings(YAxisSettings yAxisSettings, std::optional<int> linkedSubplotIdx = std::nullopt)#
Control how the y-axis is displayed.
- Parameters:
yAxisSettings – YAxisSettings struct of axis settings.
linkedSubplotIdx – The linked subplot on which to set the settings. If
nullopt, will be applied to all linked subplots.
-
void pinYAxis(bool on = true, std::optional<int> linkedSubplotIdx = std::nullopt)#
Fix the y-axis zoom to the minimum and maximum values of the plot currently in view.
- Parameters:
on – If
false, y-axis is unpinned and can be zoomed freely.linkedSubplotIdx – The linked subplot to pin. If
nullopt, will be applied to all linked subplots.
-
void setYLimits(std::optional<double> min, std::optional<double> max, std::optional<int> linkedSubplotIdx = std::nullopt)#
Set minimum and / or maximum values for the y-axis.
Only has an effect if pinYAxis is set to
false.- Parameters:
min – Minimum value for the y-axis, if
nulloptis set to -inf.max – Maximum value for the y-axis, if
nulloptis set to inf.linkedSubplotIdx – The linked subplot on which to limit the y-axis view. If
nullopt, will be applied to all linked subplots.
-
void setXLimits(std::optional<std::variant<int, std::string, std::chrono::system_clock::time_point>> min, std::optional<std::variant<int, std::string, std::chrono::system_clock::time_point>> max)#
Set the minimum and maximum values for the x-axis.
Must be the same type as the x-axis data. x-axis values should be unique.
-
void linkYAxis(bool on = true)#
Link the y-axis across all linked subplots.
- Parameters:
on – If
true, zooming on one plot will zoom on all linked subplots.
-
void setYLabel(std::string text, std::optional<AxisLabelSettings> settings = std::nullopt)#
Set a label on the y-axis for the subplot.
- Parameters:
text – Text to set as the label.
settings – AxisLabelSettings that control the display of the label.
-
void setXLabel(std::string text, std::optional<AxisLabelSettings> settings = std::nullopt)#
Set a label on the x-axis for the subplot.
- Parameters:
text – Text to set as the label.
settings – AxisLabelSettings that control the display of the label. If
nullopt, defaults are used.
-
void setTitle(std::string text, std::optional<TitleLabelSettings> settings = std::nullopt)#
Set a title on the subplot.
- Parameters:
text – Text to set as the title.
settings – TitleLabelSettings that control the display of the label.
-
void setLegend(std::vector<std::string> labelNames, std::optional<LegendSettings> legendSettings = std::nullopt, int linkedSubplotIdx = -1)#
Set a legend on linked subplots.
- Parameters:
labelNames – A vector of strings to set as the legend item labels.
legendSettings – LegendSettings struct that controls the display of the legend. If
nullopt, defaults are used.linkedSubplotIdx – The linked subplot to set the legend on. By default, it is the most recently added linked subplot.
-
void setLegend(std::vector<LegendItem> labelItems, std::optional<LegendSettings> legendSettings = std::nullopt, int linkedSubplotIdx = -1)#
Set a legend on linked subplots.
- Parameters:
labelItems – A vector of LegendItems, where LegendItem contains a label string and colors to set on the item bar.
legendSettings – LegendSettings struct that controls the display of the legend. If
nullopt, defaults are used.linkedSubplotIdx – The linked subplot to set the legend on. By default, it is the most recently added linked subplot.
-
void addSubplot(int row, int col, int rowSpan = 1, int colSpan = 1)#
Add a new subplot to the figure.
After adding, all calls on Plotter will operate on the added subplot. To change, use setActiveSubplot.
Specify the row and col index at which to add the subplot, as well as how many rows and columns it spans. For example, to add a second subplot when there is 1 existing plot: (0, 1, 1, 1) will add a new subplot to the right of the existing plot. (1, 0, 1, 1) will add the new subplot underneath the existing plot.
Note that a ‘subplot’ is a different entity to a ‘linked subplot’. All linked subplots share the x-axis, while a subplot is a completely separate set of plots.
- Parameters:
row – Index of the row in which to add the subplot.
col – Index of the column in which to add the subplot.
rowSpan – Number of rows the subplot will span.
colSpan – Number of columns the subplot will span.
-
void setActiveSubplot(int row, int col)#
Set the ‘active’ subplot to the subplot at index row, col.
All calls to Plotter e.g. Plotter.candlestick() operate on the active subplot.
-
void addLinkedSubplot(double heightAsProportion)#
Add a linked subplot to the subplot.
A ‘linked subplot’ is a subplot that shares the x-axis with the current plot. This is in contrast to a ‘subplot’ which is an entirely separate plot.
- Parameters:
heightAsProportion – The height of the new linked subplot as a proportion of the plot (in range [0, 1]).
-
void resizeLinkedSubplots(std::vector<double> yHeights)#
Resize the linked subplots.
- Parameters:
yHeights – A vector of height proportions. Length must equal the number of linked subplots on the plot and must sum to 1.
-
void candlestick(const std::vector<float> &open, const std::vector<float> &high, const std::vector<float> &low, const std::vector<float> &close, std::optional<CandlestickSettings> candlestickSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a candlestick plot.
- Parameters:
open – Vector of candle open prices.
high – Vector of candle high prices.
low – Vector of candle low prices.
close – Vector of candle close prices.
candlestickSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the candlesticks. By default, it is the most recently added linked subplot.
-
void candlestick(const std::vector<float> &open, const std::vector<float> &high, const std::vector<float> &low, const std::vector<float> &close, const std::vector<std::string> &dates, std::optional<CandlestickSettings> candlestickSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a candlestick plot with string x-labels.
- Parameters:
open – Vector of candle open prices.
high – Vector of candle high prices.
low – Vector of candle low prices.
close – Vector of candle close prices.
dates – Vector of strings used for x-axis tick labels. Must be same size as other vector inputs.
candlestickSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the candlesticks. By default, it is the most recently added linked subplot.
-
void candlestick(const std::vector<float> &open, const std::vector<float> &high, const std::vector<float> &low, const std::vector<float> &close, const std::vector<std::chrono::system_clock::time_point> &dates, std::optional<CandlestickSettings> candlestickSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a candlestick plot with UTC chrono-timepoints as x-labels.
- Parameters:
open – Vector of candle open prices.
high – Vector of candle high prices.
low – Vector of candle low prices.
close – Vector of candle close prices.
dates – Vector of chrono::timepoints (UTC) used for x-axis tick labels. Must be same size as other vector inputs.
candlestickSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the candlesticks. By default, it is the most recently added linked subplot.
-
void candlestick(const float *openPtr, std::size_t openSize, const float *highPtr, std::size_t highSize, const float *lowPtr, std::size_t lowSize, const float *closePtr, std::size_t closeSize, const OptionalDateVector dates = std::nullopt, std::optional<CandlestickSettings> candlestickSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a candlestick plot.
This is mostly for internal use and instead of std::vector<float>& takes pointers and size to such an array.
- Parameters:
openPtr – Pointer to array of floats of open prices.
openSize – Size of the open prices array.
highPtr – Pointer to array of floats of high prices..
highSize – Size of the high prices array.
lowPtr – Pointer to array of floats of low prices.
lowSize – Size of the low prices array.
closePtr – Pointer to array of floats of close prices.
closeSize – Size of the close prices array.
dates – Array of string or timepoints used as x-axis labels. If
nullopt, integers starting at 0 are used.candlestickSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the candlesticks. By default, it is the most recently added linked subplot.
-
void line(const std::vector<float> &yData, const OptionalDateVector dates, std::optional<LineSettings> lineSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a line plot.
- Parameters:
yData – Vector of float datapoints to plot.
dates – Vector of string or chrono::timepoint (UTC) to use as x tick labels.
lineSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the line plot. By default, it is the most recently added linked subplot.
-
void line(const std::vector<float> &yData, std::optional<LineSettings> lineSettings = std::nullopt, int linkedSubplotIdx = -1)#
line
- Parameters:
yData – Vector of float datapoints to plot.
lineSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the line plot. By default, it is the most recently added linked subplot.
-
void line(const float *yPtr, std::size_t ySize, const OptionalDateVector dates = std::nullopt, std::optional<LineSettings> lineSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a line plot.
- Parameters:
yPtr – Pointer to a vector of floats to plot.
ySize – Size of the float vector.
dates – string or chrono::timepoint (UTC) to use as x-tick labels. If
nullopt, integers starting at 0 are used.lineSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the line plot. By default, it is the most recently added linked subplot.
-
void bar(const std::vector<float> &yData, const OptionalDateVector dates, std::optional<BarSettings> barSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a bar plot.
- Parameters:
yData – Vector of float datapoints to plot.
dates – Vector of string or chrono::timepoint (UTC) to use as x tick labels.
barSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the bar plot. By default, it is the most recently added linked subplot.
-
void bar(const std::vector<float> &yData, std::optional<BarSettings> barSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a bar plot.
- Parameters:
yData – Vector of float datapoints to plot.
barSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the bar plot. By default, it is the most recently added linked subplot.
-
void bar(const float *yPtr, std::size_t ySize, const OptionalDateVector xData = std::nullopt, std::optional<BarSettings> barSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a bar plot.
- Parameters:
yPtr – Pointer to a vector of floats to plot.
ySize – Size of the float vector.
dates – string or chrono::timepoint (UTC) to use as x-tick labels. If
nullopt, integers starting at 0 are used.barSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the bar plot. By default, it is the most recently added linked subplot.
-
void scatter(const std::vector<std::chrono::system_clock::time_point> &xData, const std::vector<float> &yData, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
Add a scatter plot.
A scatter plot cannot be the first plot, it must be overlaid onto an existing plot.
- Parameters:
xData – A vector of chrono::time_point (UTC) of x-axis position of the scatter points. The type must match the current x tick label type.
yData – Vector of floats containing y-axis data. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
void scatter(const std::vector<std::chrono::system_clock::time_point> &xData, const float *yPtr, std::size_t ySize, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
scatter
A scatter plot cannot be the first plot, it must be overlaid onto an existing plot.
- Parameters:
xData – A vector of chrono::time_point (UTC) of x-axis position of the scatter points. The type must match the current x tick label type.
yPtr – Pointer to vector of floats containing y-axis data.
ySize – Size of vector of floats yPtr points to. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
void scatter(const std::vector<std::string> &xData, const std::vector<float> &yData, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
scatter
- Parameters:
xData – A vector of strings of x-axis position of the scatter points. The type must match the current x tick label type.
yData – Vector of floats containing y-axis data. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
void scatter(const std::vector<std::string> &xData, const float *yPtr, std::size_t ySize, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
scatter
- Parameters:
xData – A vector of strings of x-axis position of the scatter points. The type must match the current x tick label type.
yPtr – Pointer to vector of floats containing y-axis data.
ySize – Size of vector of floats yPtr points to. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
void scatter(const std::vector<int> &xData, const std::vector<float> &yData, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
scatter
- Parameters:
xData – A vector of integers of x-axis position of the scatter points. The type must match the current x tick label type.
yData – Vector of floats containing y-axis data. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
void scatter(const int *xPtr, std::size_t xSize, const float *yPtr, std::size_t ySize, std::optional<ScatterSettings> scatterSettings = std::nullopt, int linkedSubplotIdx = -1)#
scatter
- Parameters:
xPtr – A pointer to a vector of integers of x-axis position of the scatter points. The type must match the current x tick label type.
xSize – Size of vector at xPtr.
yPtr – Pointer to vector of floats containing y-axis data.
ySize – Size of vector of floats yPtr points to. Must match xData in length.
scatterSettings –
linkedSubplotIdx – The index of the linked subplot on which to plot the scatter plot. By default, it is the most recently added linked subplot.
-
CandleDataCSV _readDataFromCSV(const std::string &dataFilepath) const#
Read data from a csv file.
Requires a .csv with “Open”, “Close”, “Low”, “High” columns and optional “Date” column.
- Parameters:
dataFilepath – Path to the .csv file.
-
std::tuple<std::vector<std::uint8_t>, int, int> _grabFrameBuffer(int row, int col)#
Private Members
-
std::unique_ptr<Impl> pImpl#
-
Plotter(std::optional<PlotterArgs> plotterArgs = std::nullopt)#
-
struct PlotterArgs#
- #include <Plotter.h>
Settings that apply to the whole figure.
Public Members
-
int width = 800#
Width of the figure window.
-
int height = 600#
Height of the figure window.
-
int antiAliasingSamples = 0#
Number of samples used in antialiasing smoothing.
Zero is off, gives best performance. Higher looks smoother but is slower. Flickering of thin-line plots may occur when less than 4.
-
int axisTickLabelFontSize = 12#
Point size for the axis tick labels.
-
bool axisRight = true#
If
true, y-axis is located on the right of the plot.Otherwise, left of the plot.
-
int widthMarginSize = 50#
Size of margin between y-axis and the edge of the figure.
-
int heightMarginSize = 25#
Size of the margin between the x-axis and the bottom edge of the figure.
-
int width = 800#
-
struct ScatterSettings#
- #include <Plotter.h>
Settings for a scatter plot.
Public Members
-
ScatterShape shape = ScatterShape::cross#
Shape of the scatter marker.
-
std::vector<float> color = {0.12f, 0.46f, 0.70f, 1.0f}#
Color of the scatter marker.
-
bool fixedSize = true#
If
true, size of the scatter marker is the same at all zooms.If
false, the size of the marker will decrease when zoomed out.
-
double markerSizeFixed = 0.025#
Size of the scatter marker when
fixedSizeistrue.
-
double markerSizeFree = 10.0#
Size of the scatter marker when
fixedSizeiffalse.
-
ScatterShape shape = ScatterShape::cross#
-
struct TitleLabelSettings : public LabelSettingsBase#
- #include <Plotter.h>
Text settings for the plot title.
-
struct XAxisSettings : public AxisSettings#
Public Functions
-
inline XAxisSettings()#
-
inline XAxisSettings()#
-
struct YAxisSettings : public AxisSettings#
Public Functions
-
inline YAxisSettings()#
-
inline YAxisSettings()#
- file Plotter.h
- #include “UserVector.h”#include <optional>#include <variant>#include <vector>#include <string>#include <memory>#include <chrono>
Defines
-
PLOTTER_API#
Typedefs
-
using StringVectorRef = std::reference_wrapper<const std::vector<std::string>>#
-
using TimepointVectorRef = std::reference_wrapper<const std::vector<std::chrono::system_clock::time_point>>#
-
using DateVector = std::variant<StringVectorRef, TimepointVectorRef>#
-
using ScatterDateVector = std::variant<StdPtrVector<int>, StringVectorRef, TimepointVectorRef>#
-
using OptionalDateVector = std::optional<DateVector>#
Enums
-
enum class CandlestickMode#
Control the display of the candle plot.
Values:
-
enumerator full#
The full candlestick with capped shadows.
-
enumerator bodyOnly#
Draw only the candlestick body.
-
enumerator noCaps#
Candlestick with uncapped shadows.
-
enumerator lineOpen#
A simple line plot of the ‘open’ data.
-
enumerator lineClose#
A simple line plot of the ‘close’ data.
-
enumerator full#
-
PLOTTER_API#
- dir cpp
- dir include
- dir src