summaryrefslogtreecommitdiff
path: root/graph.h
blob: 7c3e862b5f486d7a6024f3405a6494f7f380a615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef GRAPH_H
#define GRAPH_H

struct graph;

#define INVISIBLE_COLOR (-1.0)

struct graph *graph_new(unsigned int xdim, unsigned int ydim, const char *font);
void graph_set_size(struct graph *g, unsigned int xdim, unsigned int ydim);
void bar_graph_draw(struct graph *g, cairo_t *cr);
void line_graph_draw(struct graph *g, cairo_t *cr);
void line_graph_set_data_count_limit(struct graph *g, int per_label_limit);
void graph_title(struct graph *g, const char *title);
void graph_x_title(struct graph *g, const char *title);
void graph_y_title(struct graph *g, const char *title);
void graph_add_label(struct graph *g, const char *label);
int graph_add_data(struct graph *g, const char *label, const double value);
int graph_add_xy_data(struct graph *g, const char *label,
		const double x, const double y);
void graph_set_color(struct graph *g, const char *label,
		double red, double green, double blue);
void graph_free(struct graph *bg);


#endif