GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_graph.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2024 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
25#ifndef GP_WIDGET_GRAPH_H
26#define GP_WIDGET_GRAPH_H
27
28#include <utils/gp_cbuffer.h>
31
57
62
68 double x;
70 double y;
71};
72
85 const char *x_label, const char *y_label,
86 size_t max_data_points);
87
98void gp_widget_graph_point_add(gp_widget *self, double x, double y);
99
107
117void gp_widget_graph_yrange_set(gp_widget *self, double min_y, double max_y);
118
127void gp_widget_graph_ymin_set(gp_widget *self, double min_y);
128
137void gp_widget_graph_ymax_set(gp_widget *self, double max_y);
138
147
155
156#endif /* GP_WIDGET_GRAPH_H */
Circular buffer indexing and iterators.
gp_widget_graph_style
A graph drawing style.
@ GP_WIDGET_GRAPH_LINE
Points connected by line.
@ GP_WIDGET_GRAPH_POINT
Point graph.
@ GP_WIDGET_GRAPH_FILL
Area below graph is filled.
@ GP_WIDGET_GRAPH_STYLE_MAX
Maximal number of styles.
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.
const char * gp_widget_graph_style_names[GP_WIDGET_GRAPH_STYLE_MAX]
A graph style names.
void gp_widget_graph_style_set(gp_widget *self, enum gp_widget_graph_style style)
Sets a graph style.
void gp_widget_graph_yrange_clear(gp_widget *self)
Clears graph y range.
void gp_widget_graph_ymin_set(gp_widget *self, double min_y)
Sets graph y minimum.
void gp_widget_graph_color_set(gp_widget *self, enum gp_widgets_color color)
Sets graph color.
void gp_widget_graph_yrange_set(gp_widget *self, double min_y, double max_y)
Sets graph y range.
void gp_widget_graph_ymax_set(gp_widget *self, double max_y)
Sets graph y maximum.
A widget size units.
Common widget types.
gp_widgets_color
Widget theme colors.
double y
An y value.
double x
An x value.
A compound size.
A widget base.
Definition gp_widget.h:28