• Home
  • Raw
  • Download

Lines Matching refs:plot

344 void setup_axis(struct plot *plot)  in setup_axis()  argument
347 int fd = plot->fd; in setup_axis()
351 if (plot->no_legend) in setup_axis()
354 plot->total_width = axis_x_off(graph_width) + graph_left_pad / 2 + local_legend_width; in setup_axis()
355 plot->total_height = axis_y() + tick_label_pad + tick_font_size; in setup_axis()
357 if (plot->add_xlabel) in setup_axis()
358 plot->total_height += bump_height; in setup_axis()
363 plot->start_x_offset, in setup_axis()
364 plot->start_y_offset, plot->total_width + 40, in setup_axis()
365 plot->total_height + 20); in setup_axis()
372 plot->start_x_offset + 15, in setup_axis()
373 plot->start_y_offset, plot->total_width, plot->total_height); in setup_axis()
376 plot->total_height += 20; in setup_axis()
377 plot->total_width += 20; in setup_axis()
379 if (plot->total_height + plot->start_y_offset > final_height) in setup_axis()
380 final_height = plot->total_height + plot->start_y_offset; in setup_axis()
381 if (plot->start_x_offset + plot->total_width + 40 > final_width) in setup_axis()
382 final_width = plot->start_x_offset + plot->total_width + 40; in setup_axis()
385 snprintf(line, line_len, "<svg x=\"%d\" y=\"%d\">\n", plot->start_x_offset, plot->start_y_offset); in setup_axis()
401 void setup_axis_spindle(struct plot *plot) in setup_axis_spindle() argument
404 int fd = plot->fd; in setup_axis_spindle()
409 plot->total_width = axis_x_off(graph_width) + legend_width; in setup_axis_spindle()
410 plot->total_height = axis_y() + tick_label_pad + tick_font_size; in setup_axis_spindle()
412 if (plot->add_xlabel) in setup_axis_spindle()
413 plot->total_height += bump_height; in setup_axis_spindle()
418 plot->start_x_offset, in setup_axis_spindle()
419 plot->start_y_offset, plot->total_width + 10, in setup_axis_spindle()
420 plot->total_height + 20); in setup_axis_spindle()
427 plot->start_x_offset + 15, in setup_axis_spindle()
428 plot->start_y_offset, plot->total_width - 30, in setup_axis_spindle()
429 plot->total_height); in setup_axis_spindle()
432 plot->total_height += 20; in setup_axis_spindle()
434 if (plot->total_height + plot->start_y_offset > final_height) in setup_axis_spindle()
435 final_height = plot->total_height + plot->start_y_offset; in setup_axis_spindle()
436 if (plot->start_x_offset + plot->total_width + 40 > final_width) in setup_axis_spindle()
437 final_width = plot->start_x_offset + plot->total_width + 40; in setup_axis_spindle()
440 snprintf(line, line_len, "<svg x=\"%d\" y=\"%d\">\n", plot->start_x_offset, plot->start_y_offset); in setup_axis_spindle()
451 void set_plot_title(struct plot *plot, char *title) in set_plot_title() argument
454 int fd = plot->fd; in set_plot_title()
456 plot->total_height = plot_title_height; in set_plot_title()
457 plot->total_width = axis_x_off(graph_width) + graph_left_pad / 2 + legend_width; in set_plot_title()
461 plot->start_y_offset, plot->total_width + 40, plot_title_height + 20); in set_plot_title()
468 plot->start_y_offset + plot_title_height / 2, in set_plot_title()
470 plot->start_y_offset += plot_title_height; in set_plot_title()
501 void set_xticks(struct plot *plot, int num_ticks, int first, int last) in set_xticks() argument
508 int tick_only = plot->add_xlabel == 0; in set_xticks()
528 write_check(plot->fd, line, strlen(line)); in set_xticks()
545 write_check(plot->fd, line, strlen(line)); in set_xticks()
561 write_check(plot->fd, line, strlen(line)); in set_xticks()
565 void set_ylabel(struct plot *plot, char *label) in set_ylabel() argument
568 int fd = plot->fd; in set_ylabel()
583 void set_xlabel(struct plot *plot, char *label) in set_xlabel() argument
586 int fd = plot->fd; in set_xlabel()
603 void set_yticks(struct plot *plot, int num_ticks, int first, int last, char *units) in set_yticks() argument
619 write_check(plot->fd, line, strlen(line)); in set_yticks()
627 write_check(plot->fd, line, strlen(line)); in set_yticks()
633 write_check(plot->fd, line, strlen(line)); in set_yticks()
636 void set_plot_label(struct plot *plot, char *label) in set_plot_label() argument
639 int fd = plot->fd; in set_plot_label()
657 int close_plot(struct plot *plot) in close_plot() argument
659 close_svg(plot->fd); in close_plot()
660 if (plot->direction == PLOT_DOWN) in close_plot()
661 plot->start_y_offset += plot->total_height; in close_plot()
662 else if (plot->direction == PLOT_ACROSS) in close_plot()
663 plot->start_x_offset += plot->total_width; in close_plot()
667 struct plot *alloc_plot(void) in alloc_plot()
669 struct plot *plot; in alloc_plot() local
670 plot = calloc(1, sizeof(*plot)); in alloc_plot()
671 if (!plot) { in alloc_plot()
675 plot->fd = 0; in alloc_plot()
676 return plot; in alloc_plot()
679 int close_plot_file(struct plot *plot) in close_plot_file() argument
682 ret = lseek(plot->fd, 0, SEEK_SET); in close_plot_file()
692 write_check(plot->fd, line, strlen(line)); in close_plot_file()
695 write_check(plot->fd, line, strlen(line)); in close_plot_file()
696 close(plot->fd); in close_plot_file()
697 plot->fd = 0; in close_plot_file()
701 void set_plot_output(struct plot *plot, char *filename) in set_plot_output() argument
705 if (plot->fd) in set_plot_output()
706 close_plot_file(plot); in set_plot_output()
712 plot->fd = fd; in set_plot_output()
713 plot->start_y_offset = plot->start_x_offset = 0; in set_plot_output()
785 int svg_line_graph(struct plot *plot, struct graph_line_data *gld, char *color, int thresh1, int th… in svg_line_graph() argument
791 int fd = plot->fd; in svg_line_graph()
855 if (plot->timeline) in svg_line_graph()
856 svg_write_time_line(plot, plot->timeline); in svg_line_graph()
861 void svg_write_time_line(struct plot *plot, int col) in svg_write_time_line() argument
867 write_check(plot->fd, line, strlen(line)); in svg_write_time_line()
880 int svg_io_graph_movie_array(struct plot *plot, struct pid_plot_history *pph) in svg_io_graph_movie_array() argument
891 svg_add_io(plot->fd, movie_row, movie_col, 4, 4, pph->color); in svg_io_graph_movie_array()
903 int svg_io_graph_movie_array_spindle(struct plot *plot, struct pid_plot_history *pph) in svg_io_graph_movie_array_spindle() argument
934 write_check(plot->fd, line, strlen(line)); in svg_io_graph_movie_array_spindle()
938 write_check(plot->fd, line, strlen(line)); in svg_io_graph_movie_array_spindle()
962 write_check(plot->fd, line, strlen(line)); in svg_io_graph_movie_array_spindle()
1019 int svg_io_graph(struct plot *plot, struct graph_dot_data *gdd) in svg_io_graph() argument
1021 int fd = plot->fd;; in svg_io_graph()
1045 void svg_alloc_legend(struct plot *plot, int num_lines) in svg_alloc_legend() argument
1048 plot->legend_index = 0; in svg_alloc_legend()
1049 plot->legend_lines = lines; in svg_alloc_legend()
1050 plot->num_legend_lines = num_lines; in svg_alloc_legend()
1053 void svg_free_legend(struct plot *plot) in svg_free_legend() argument
1056 for (i = 0; i < plot->legend_index; i++) in svg_free_legend()
1057 free(plot->legend_lines[i]); in svg_free_legend()
1058 free(plot->legend_lines); in svg_free_legend()
1059 plot->legend_lines = NULL; in svg_free_legend()
1060 plot->legend_index = 0; in svg_free_legend()
1063 void svg_write_legend(struct plot *plot) in svg_write_legend() argument
1069 if (plot->legend_index == 0) in svg_write_legend()
1077 plot->legend_index * legend_font_size + legend_font_size / 2 + 12); in svg_write_legend()
1079 write_check(plot->fd, line, strlen(line)); in svg_write_legend()
1080 for (i = 0; i < plot->legend_index; i++) { in svg_write_legend()
1081 write_check(plot->fd, plot->legend_lines[i], in svg_write_legend()
1082 strlen(plot->legend_lines[i])); in svg_write_legend()
1083 free(plot->legend_lines[i]); in svg_write_legend()
1085 free(plot->legend_lines); in svg_write_legend()
1086 plot->legend_lines = NULL; in svg_write_legend()
1087 plot->legend_index = 0; in svg_write_legend()
1090 void svg_add_legend(struct plot *plot, char *text, char *extra, char *color) in svg_add_legend() argument
1098 legend_line_y += plot->legend_index * legend_font_size + legend_font_size / 2; in svg_add_legend()
1108 plot->legend_lines[plot->legend_index++] = strdup(line); in svg_add_legend()