summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e42aa1)
raw | patch | inline | side by side (parent: 5e42aa1)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 22 Nov 2011 17:13:13 +0000 (17:13 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 22 Nov 2011 17:13:13 +0000 (17:13 +0000) |
program/doc/rrdgraph.pod | patch | blob | history | |
program/src/rrd_graph.c | patch | blob | history |
index be421e869ed467eddb602bb2ee6d0fb1412002ee..71a1e1dde1236d1512d7a7533aa42e69c9d50f08 100644 (file)
--- a/program/doc/rrdgraph.pod
+++ b/program/doc/rrdgraph.pod
each day. The labels are placed exactly between two major grid lines
as they specify the complete day and not just midnight.
each day. The labels are placed exactly between two major grid lines
as they specify the complete day and not just midnight.
+[B<--week-fmt> I<strftime format string>]
+
+By default rrdtool uses "Week %V" to render the week number. With this option
+you can define your own format, without completely overriding the xaxis format.
+
=head2 Y-Axis
[B<-y>|B<--y-grid> I<grid step>B<:>I<label factor>]
=head2 Y-Axis
[B<-y>|B<--y-grid> I<grid step>B<:>I<label factor>]
index 706bd49505e68b341c17fd2551e4d1c0f10f4d40..d7781f6dec454edd7b6b9d19a8784d6801c1713d 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
{5.5, RRD_DEFAULT_FONT,NULL} /* watermark */
};
{5.5, RRD_DEFAULT_FONT,NULL} /* watermark */
};
+char week_fmt[128] = "Week %V";
+
xlab_t xlab[] = {
{0, 0, TMT_SECOND, 30, TMT_MINUTE, 5, TMT_MINUTE, 5, 0, "%H:%M"}
,
xlab_t xlab[] = {
{0, 0, TMT_SECOND, 30, TMT_MINUTE, 5, TMT_MINUTE, 5, 0, "%H:%M"}
,
,
{2400, 0, TMT_HOUR, 12, TMT_DAY, 1, TMT_DAY, 2, 24 * 3600, "%a"}
,
,
{2400, 0, TMT_HOUR, 12, TMT_DAY, 1, TMT_DAY, 2, 24 * 3600, "%a"}
,
- {3600, 0, TMT_DAY, 1, TMT_WEEK, 1, TMT_WEEK, 1, 7 * 24 * 3600, "Week %V"}
+ {3600, 0, TMT_DAY, 1, TMT_WEEK, 1, TMT_WEEK, 1, 7 * 24 * 3600, week_fmt}
,
{3 * 3600, 0, TMT_WEEK, 1, TMT_MONTH, 1, TMT_WEEK, 2, 7 * 24 * 3600,
,
{3 * 3600, 0, TMT_WEEK, 1, TMT_MONTH, 1, TMT_WEEK, 2, 7 * 24 * 3600,
- "Week %V"}
+ week_fmt}
,
{6 * 3600, 0, TMT_MONTH, 1, TMT_MONTH, 1, TMT_MONTH, 1, 30 * 24 * 3600,
"%b"}
,
{6 * 3600, 0, TMT_MONTH, 1, TMT_MONTH, 1, TMT_MONTH, 1, 30 * 24 * 3600,
"%b"}
{ "border", required_argument, 0, 1007},
{ "grid-dash", required_argument, 0, 1008},
{ "dynamic-labels", no_argument, 0, 1009},
{ "border", required_argument, 0, 1007},
{ "grid-dash", required_argument, 0, 1008},
{ "dynamic-labels", no_argument, 0, 1009},
+ { "week-fmt", required_argument, 0, 1010},
{ 0, 0, 0, 0}
};
/* *INDENT-ON* */
{ 0, 0, 0, 0}
};
/* *INDENT-ON* */
case 1009: /* enable dynamic labels */
im->dynamic_labels = 1;
break;
case 1009: /* enable dynamic labels */
im->dynamic_labels = 1;
break;
+ case 1010:
+ strncpy(week_fmt,optarg,sizeof week_fmt);
+ week_fmt[(sizeof week_fmt)-1]='\0';
+ break;
case 1002: /* right y axis */
if(sscanf(optarg,
case 1002: /* right y axis */
if(sscanf(optarg,