Lines Matching refs:bg
237 static void draw_bars(struct graph *bg, cairo_t *cr, struct graph_label *lb, in draw_bars() argument
247 range = (double) bg->ydim * 0.80; /* FIXME */ in draw_bars()
256 y2 = bg->ydim * 0.90; in draw_bars()
436 void bar_graph_draw(struct graph *bg, cairo_t *cr) in bar_graph_draw() argument
446 cairo_translate(cr, bg->xoffset, bg->yoffset); in bar_graph_draw()
447 graph_draw_common(bg, cr, &x1, &y1, &x2, &y2); in bar_graph_draw()
449 nlabels = count_labels(bg); in bar_graph_draw()
456 mindata = find_min_data(bg); in bar_graph_draw()
460 maxdata = find_max_data(bg); in bar_graph_draw()
463 draw_centered_text(cr, bg->font, in bar_graph_draw()
469 maxdata = graph_draw_y_ticks(bg, cr, x1, y1, x2, y2, mindata, maxdata, 10, 1); in bar_graph_draw()
471 flist_for_each(entry, &bg->label_list) { in bar_graph_draw()
477 label_offset = bg->xdim * 0.1 + space_per_label * (double) i + space_per_label * 0.1; in bar_graph_draw()
478 draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata); in bar_graph_draw()
480 draw_centered_text(cr, bg->font, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93, in bar_graph_draw()
621 void graph_title(struct graph *bg, const char *title) in graph_title() argument
623 setstring(&bg->title, title); in graph_title()
626 void graph_x_title(struct graph *bg, const char *title) in graph_x_title() argument
628 setstring(&bg->xtitle, title); in graph_x_title()
631 void graph_y_title(struct graph *bg, const char *title) in graph_y_title() argument
633 setstring(&bg->ytitle, title); in graph_y_title()
636 static struct graph_label *graph_find_label(struct graph *bg, in graph_find_label() argument
642 flist_for_each(entry, &bg->label_list) { in graph_find_label()
652 graph_label_t graph_add_label(struct graph *bg, const char *label) in graph_add_label() argument
656 i = graph_find_label(bg, label); in graph_add_label()
661 i->parent = bg; in graph_add_label()
663 flist_add_tail(&i->list, &bg->label_list); in graph_add_label()
788 int graph_add_data(struct graph *bg, graph_label_t label, const double value) in graph_add_data() argument
815 int graph_add_xy_data(struct graph *bg, graph_label_t label, in graph_add_xy_data() argument
821 if (bg->dont_graph_all_zeroes && y == 0.0 && !graph_nonzero_y(i)) in graph_add_xy_data()
895 void graph_free(struct graph *bg) in graph_free() argument
897 free(bg->title); in graph_free()
898 free(bg->xtitle); in graph_free()
899 free(bg->ytitle); in graph_free()
900 graph_free_labels(bg); in graph_free()