GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
widgets
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
>
29
#include <
widgets/gp_widget_types.h
>
30
#include <
widgets/gp_widget_size_units.h
>
31
35
enum
gp_widget_graph_style
{
41
GP_WIDGET_GRAPH_POINT
,
47
GP_WIDGET_GRAPH_LINE
,
53
GP_WIDGET_GRAPH_FILL
,
55
GP_WIDGET_GRAPH_STYLE_MAX
,
56
};
57
61
extern
const
char
*
gp_widget_graph_style_names
[
GP_WIDGET_GRAPH_STYLE_MAX
];
62
66
struct
gp_widget_graph_point
{
68
double
x
;
70
double
y
;
71
};
72
84
gp_widget
*
gp_widget_graph_new
(
gp_widget_size
min_w,
gp_widget_size
min_h,
85
const
char
*x_label,
const
char
*y_label,
86
size_t
max_data_points);
87
98
void
gp_widget_graph_point_add
(
gp_widget
*self,
double
x,
double
y);
99
106
void
gp_widget_graph_style_set
(
gp_widget
*self,
enum
gp_widget_graph_style
style);
107
117
void
gp_widget_graph_yrange_set
(
gp_widget
*self,
double
min_y,
double
max_y);
118
127
void
gp_widget_graph_ymin_set
(
gp_widget
*self,
double
min_y);
128
137
void
gp_widget_graph_ymax_set
(
gp_widget
*self,
double
max_y);
138
146
void
gp_widget_graph_yrange_clear
(
gp_widget
*self);
147
154
void
gp_widget_graph_color_set
(
gp_widget
*self,
enum
gp_widgets_color
color);
155
156
#endif
/* GP_WIDGET_GRAPH_H */
gp_cbuffer.h
Circular buffer indexing and iterators.
gp_widget_graph_style
gp_widget_graph_style
A graph drawing style.
Definition
gp_widget_graph.h:35
GP_WIDGET_GRAPH_LINE
@ GP_WIDGET_GRAPH_LINE
Points connected by line.
Definition
gp_widget_graph.h:47
GP_WIDGET_GRAPH_POINT
@ GP_WIDGET_GRAPH_POINT
Point graph.
Definition
gp_widget_graph.h:41
GP_WIDGET_GRAPH_FILL
@ GP_WIDGET_GRAPH_FILL
Area below graph is filled.
Definition
gp_widget_graph.h:53
GP_WIDGET_GRAPH_STYLE_MAX
@ GP_WIDGET_GRAPH_STYLE_MAX
Maximal number of styles.
Definition
gp_widget_graph.h:55
gp_widget_graph_new
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.
gp_widget_graph_point_add
void gp_widget_graph_point_add(gp_widget *self, double x, double y)
Adds a graph point.
gp_widget_graph_style_names
const char * gp_widget_graph_style_names[GP_WIDGET_GRAPH_STYLE_MAX]
A graph style names.
gp_widget_graph_style_set
void gp_widget_graph_style_set(gp_widget *self, enum gp_widget_graph_style style)
Sets a graph style.
gp_widget_graph_yrange_clear
void gp_widget_graph_yrange_clear(gp_widget *self)
Clears graph y range.
gp_widget_graph_ymin_set
void gp_widget_graph_ymin_set(gp_widget *self, double min_y)
Sets graph y minimum.
gp_widget_graph_color_set
void gp_widget_graph_color_set(gp_widget *self, enum gp_widgets_color color)
Sets graph color.
gp_widget_graph_yrange_set
void gp_widget_graph_yrange_set(gp_widget *self, double min_y, double max_y)
Sets graph y range.
gp_widget_graph_ymax_set
void gp_widget_graph_ymax_set(gp_widget *self, double max_y)
Sets graph y maximum.
gp_widget_size_units.h
A widget size units.
gp_widget_types.h
Common widget types.
gp_widgets_color
gp_widgets_color
Widget theme colors.
Definition
gp_widgets_color_scheme.h:74
gp_widget_graph_point
A graph point.
Definition
gp_widget_graph.h:66
gp_widget_graph_point::y
double y
An y value.
Definition
gp_widget_graph.h:70
gp_widget_graph_point::x
double x
An x value.
Definition
gp_widget_graph.h:68
gp_widget_size
A compound size.
Definition
gp_widget_size_units.h:31
gp_widget
A widget base.
Definition
gp_widget.h:28
Generated by
1.9.8