An XY graph.
More...
Go to the source code of this file.
|
gp_widget * | gp_widget_graph_new (gp_widget_size min_w, gp_widget_size min_h, const char *x_label, const char *y_label, size_t max_data_points) |
| Allocates and initializes a new graph widget.
|
|
void | gp_widget_graph_point_add (gp_widget *self, double x, double y) |
| Adds a graph point.
|
|
void | gp_widget_graph_style_set (gp_widget *self, enum gp_widget_graph_style style) |
| Sets a graph style.
|
|
void | gp_widget_graph_yrange_set (gp_widget *self, double min_y, double max_y) |
| Sets graph y range.
|
|
void | gp_widget_graph_ymin_set (gp_widget *self, double min_y) |
| Sets graph y minimum.
|
|
void | gp_widget_graph_ymax_set (gp_widget *self, double max_y) |
| Sets graph y maximum.
|
|
void | gp_widget_graph_yrange_clear (gp_widget *self) |
| Clears graph y range.
|
|
void | gp_widget_graph_color_set (gp_widget *self, enum gp_widgets_color color) |
| Sets graph color.
|
|
An XY graph.
Graph widget JSON attributes
Definition in file gp_widget_graph.h.
◆ gp_widget_graph_style
A graph drawing style.
Enumerator |
---|
GP_WIDGET_GRAPH_POINT | Point graph.
Graph is drawn using individual points.
|
GP_WIDGET_GRAPH_LINE | Points connected by line.
The graph points are connected by a line.
|
GP_WIDGET_GRAPH_FILL | Area below graph is filled.
The area bellow the line created by the graph points is filled.
|
GP_WIDGET_GRAPH_STYLE_MAX | Maximal number of styles.
|
Definition at line 35 of file gp_widget_graph.h.
◆ gp_widget_graph_color_set()
Sets graph color.
- Parameters
-
self | A graph widget. |
color | An color index. |
◆ gp_widget_graph_new()
Allocates and initializes a new graph widget.
- Parameters
-
min_w | A minimal width. |
min_h | A minimal height. |
x_label | A label for the x axis. |
y_label | A label for the y axis. |
max_data_points | A maximal number of graph data points. |
- Returns
- A graph widget.
◆ gp_widget_graph_point_add()
void gp_widget_graph_point_add |
( |
gp_widget * |
self, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
Adds a graph point.
The graph data are stored in a circular buffer, when buffer is full the last data point is discarded before new point is added.
- Parameters
-
self | A graph widget. |
x | A x coordinate of the data point. |
y | A y coordinate of the data point. |
◆ gp_widget_graph_style_set()
Sets a graph style.
- Parameters
-
self | A graph widget. |
style | A graph style. |
◆ gp_widget_graph_ymax_set()
void gp_widget_graph_ymax_set |
( |
gp_widget * |
self, |
|
|
double |
max_y |
|
) |
| |
Sets graph y maximum.
If range is not set the graph is autorange mode and the data will fit the y scale.
- Parameters
-
self | A graph widget. |
max_y | New y maximum. |
◆ gp_widget_graph_ymin_set()
void gp_widget_graph_ymin_set |
( |
gp_widget * |
self, |
|
|
double |
min_y |
|
) |
| |
Sets graph y minimum.
If range is not set the graph is autorange mode and the data will fit the y scale.
- Parameters
-
self | A graph widget. |
min_y | New y minimum. |
◆ gp_widget_graph_yrange_clear()
void gp_widget_graph_yrange_clear |
( |
gp_widget * |
self | ) |
|
Clears graph y range.
Returns graph widget into autorange mode.
- Parameters
-
◆ gp_widget_graph_yrange_set()
void gp_widget_graph_yrange_set |
( |
gp_widget * |
self, |
|
|
double |
min_y, |
|
|
double |
max_y |
|
) |
| |
Sets graph y range.
If range is not set the graph is autorange mode and the data will fit the y scale.
- Parameters
-
self | A graph widget. |
min_y | New y minimum. |
max_y | New y maximum. |