GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
An XY graph. More...
#include <utils/gp_cbuffer.h>
#include <widgets/gp_widget_types.h>
#include <widgets/gp_widget_size_units.h>
Go to the source code of this file.
Data Structures | |
struct | gp_widget_graph_point |
A graph point. More... | |
Enumerations | |
enum | gp_widget_graph_style { GP_WIDGET_GRAPH_POINT , GP_WIDGET_GRAPH_LINE , GP_WIDGET_GRAPH_FILL , GP_WIDGET_GRAPH_STYLE_MAX } |
A graph drawing style. More... | |
Functions | |
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. | |
Variables | |
const char * | gp_widget_graph_style_names [GP_WIDGET_GRAPH_STYLE_MAX] |
A graph style names. | |
An XY graph.
Definition in file gp_widget_graph.h.
A graph drawing style.
Enumerator | |
---|---|
GP_WIDGET_GRAPH_POINT | Point graph |
GP_WIDGET_GRAPH_LINE | Points connected by line |
GP_WIDGET_GRAPH_FILL | Area below graph is filled |
GP_WIDGET_GRAPH_STYLE_MAX | Maximal number of styles |
Definition at line 24 of file gp_widget_graph.h.
void gp_widget_graph_color_set | ( | gp_widget * | self, |
enum gp_widgets_color | color | ||
) |
Sets graph color.
self | A graph widget. |
color | An color index. |
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.
self | A graph widget. |
x | A x coordinate of the data point. |
y | A y coordinate of the data point. |
void gp_widget_graph_style_set | ( | gp_widget * | self, |
enum gp_widget_graph_style | style | ||
) |
Sets a graph style.
self | A graph widget. |
style | A graph style. |
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.
self | A graph widget. |
max_y | New y maximum. |
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.
self | A graph widget. |
min_y | New y minimum. |
void gp_widget_graph_yrange_clear | ( | gp_widget * | self | ) |
Clears graph y range.
Returns graph widget into autorange mode.
self | A graph widget. |
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.
self | A graph widget. |
min_y | New y minimum. |
max_y | New y maximum. |