|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
ASCII chart renderer for plotting data series in the terminal. More...
#include <ascii.h>
Public Types | |
| enum | Type { LINE = 0 , CIRCLE = 1 } |
| Chart rendering mode. More... | |
Public Member Functions | |
| Asciichart (const std::vector< double > &series) | |
| Construct an Asciichart from a single data series. More... | |
| Asciichart (const std::vector< std::vector< double >> &series) | |
| Construct an Asciichart from multiple unnamed data series. More... | |
| Asciichart (const std::unordered_map< std::string, std::vector< double >> &series) | |
| Construct an Asciichart from named data series (label -> values map). More... | |
| Asciichart & | type (Type type) |
| Set the chart rendering type. More... | |
| Asciichart & | height (double height) |
| Set the height of the chart in data units. More... | |
| Asciichart & | styles (const std::vector< Style > &styles) |
| Set the styles (colors and decorations) for each data series. More... | |
| Asciichart & | min (double min) |
| Set the minimum value displayed on the y-axis. More... | |
| Asciichart & | max (double max) |
| Set the maximum value displayed on the y-axis. More... | |
| Asciichart & | offset (size_t offset) |
| Set the offset (left margin) for the chart content. More... | |
| Asciichart & | legend_padding (size_t padding) |
| Set the padding between series labels and the chart. More... | |
| Asciichart & | show_legend (bool show) |
| Enable or disable the legend display. More... | |
| Asciichart & | symbols (const std::map< std::string, std::string > &symbols) |
| Set custom symbols used to draw the chart. More... | |
| std::string | Plot () |
| Generate and return the ASCII chart as a string. More... | |
ASCII chart renderer for plotting data series in the terminal.
Supports line and circle chart types with configurable height, colors, legends, and custom symbols. Uses ANSI escape codes for styling. Charts can be rendered from single or multiple data series with optional labels for each series.
Example usage:
|
inlineexplicit |
Construct an Asciichart from a single data series.
| series | the data points to plot |
|
inlineexplicit |
Construct an Asciichart from multiple unnamed data series.
| series | a vector of data series to plot |
|
inlineexplicit |
Construct an Asciichart from named data series (label -> values map).
| series | a map of series names to their data points |
|
inline |
Set the height of the chart in data units.
If not specified or set to NaN, the height is automatically determined from the data range.
| height | the chart height in data units |
|
inline |
Set the padding between series labels and the chart.
| padding | the space width in characters |
|
inline |
Set the maximum value displayed on the y-axis.
The displayed maximum will be the larger of this value and the actual maximum in the data.
| max | the maximum y-value to display |
|
inline |
Set the minimum value displayed on the y-axis.
The displayed minimum will be the smaller of this value and the actual minimum in the data.
| min | the minimum y-value to display |
|
inline |
Set the offset (left margin) for the chart content.
The offset determines how many columns are reserved for the y-axis labels before the plot area begins.
| offset | the left margin width in characters |
|
inline |
|
inline |
Enable or disable the legend display.
| show | if true, display series names in the legend |
|
inline |
Set the styles (colors and decorations) for each data series.
| styles | a vector of Style objects, one per series |
|
inline |
Set custom symbols used to draw the chart.
Supported symbol keys: "empty", "center", "axis", "c1", "c2", "parellel", "down", "up", "ldown", "lup", "vertical".
| symbols | a map of symbol names to their characters |
|
inline |
Set the chart rendering type.
| type | the chart type (LINE or CIRCLE) |