* new graph option --border to set the 3d border width
by Bernhard Reutner-Fischer
-* draw different color swats depending on the type of line drawn in the
- graph by Loïc Tortay
+* draw different color markers (enable with --dynamic-labels) depending on the
+ type of element in the graph by Loïc Tortay
for more detail see the CHANGES file.
boxV = boxH;
/* shift the box up a bit */
Y0 -= boxV * 0.4;
- if (im->gdes[i].gf == GF_HRULE) { /* [-] */
+
+ if (im->dynamic_labels && im->gdes[i].gf == GF_HRULE) { /* [-] */
cairo_save(im->cr);
cairo_new_path(im->cr);
cairo_set_line_width(im->cr, 1.0);
X0 + boxH, Y0 - boxV / 2,
1.0, im->gdes[i].col);
gfx_close_path(im);
- } else if (im->gdes[i].gf == GF_VRULE) { /* [|] */
+ } else if (im->dynamic_labels && im->gdes[i].gf == GF_VRULE) { /* [|] */
cairo_save(im->cr);
cairo_new_path(im->cr);
cairo_set_line_width(im->cr, 1.0);
X0 + boxH / 2, Y0 - boxV,
1.0, im->gdes[i].col);
gfx_close_path(im);
- } else if (im->gdes[i].gf == GF_LINE) { /* [/] */
+ } else if (im->dynamic_labels && im->gdes[i].gf == GF_LINE) { /* [/] */
cairo_save(im->cr);
cairo_new_path(im->cr);
cairo_set_line_width(im->cr, im->gdes[i].linewidth);
im->draw_x_grid = 1;
im->draw_y_grid = 1;
im->draw_3d_border = 2;
+ im->dynamic_labels = 0;
im->extra_flags = 0;
im->font_options = cairo_font_options_create();
im->forceleftspace = 0;
{ "legend-direction", required_argument, 0, 1006},
{ "border", required_argument, 0, 1007},
{ "grid-dash", required_argument, 0, 1008},
+ { "dynamic-labels", no_argument, 0, 1009},
{ 0, 0, 0, 0}
};
/* *INDENT-ON* */
rrd_set_error("expected grid-dash format float:float");
return;
}
- break;
+ break;
+ case 1009: /* enable dynamic labels */
+ im->dynamic_labels = 1;
+ break;
case 1002: /* right y axis */
if(sscanf(optarg,
int draw_x_grid; /* no x-grid at all */
int draw_y_grid; /* no y-grid at all */
unsigned int draw_3d_border; /* size of border in pixels, 0 for off */
+ unsigned int dynamic_labels; /* pick the label shape according to the line drawn */
double grid_dash_on, grid_dash_off;
xlab_t xlab_user; /* user defined labeling for xaxis */
char xlab_form[210]; /* format for the label on the xaxis */