|
From: <cob...@us...> - 2003-09-30 21:45:27
|
Update of /cvsroot/jrobin/src/jrobin/mrtg/server
In directory sc8-pr-cvs1:/tmp/cvs-serv8118/src/jrobin/mrtg/server
Modified Files:
Grapher.java
Log Message:
GRAPH LIB UPDATES
Fix zero comment line problem
Option to disable the legend
Option to bring grid to front or back
Option to set rigid grid lines
Option to set fixed upper and lower value
Add change border option
Possibility to disable grid lines (no minor grid)
Fix background color option
Better Time and Value axis markers
Index: Grapher.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/mrtg/server/Grapher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Grapher.java 4 Sep 2003 13:28:38 -0000 1.1
--- Grapher.java 30 Sep 2003 21:45:21 -0000 1.2
***************
*** 32,36 ****
class Grapher {
! static final int GRAPH_WIDTH = 600, GRAPH_HEIGHT = 400;
private String ifDescr, host, alias;
--- 32,36 ----
class Grapher {
! static final int GRAPH_WIDTH = 502, GRAPH_HEIGHT = 234;
private String ifDescr, host, alias;
***************
*** 56,59 ****
--- 56,60 ----
RrdGraphDef gDef = new RrdGraphDef();
try {
+ gDef.setImageBorder(Color.WHITE, 0); // Don't show border
gDef.setTimePeriod(start, stop);
gDef.setTitle(ifDescr + "@" + host);
***************
*** 64,76 ****
gDef.datasource("in8", "in,8,*");
gDef.datasource("out8", "out,8,*");
! gDef.area("out8", Color.GREEN, "output traffic");
! gDef.line("in8", Color.BLUE, "input traffic");
! gDef.gprint("in8", "AVERAGE", "avgIn=@2 @sbits/sec");
! gDef.gprint("in8", "MAX", "maxIn=@2 @Sbits/sec@r");
! gDef.gprint("out8", "AVERAGE", "avgOut=@2 @sbits/sec");
! gDef.gprint("out8", "MAX", "maxOut=@2 @Sbits/sec@r");
! gDef.comment("Start time: " + new Date(start * 1000L));
! gDef.comment("End time: " + new Date(stop * 1000L + 1) + "@r");
! gDef.comment("Description on device: " + alias + "@r");
return new RrdGraph(gDef);
} catch (RrdException e) {
--- 65,80 ----
gDef.datasource("in8", "in,8,*");
gDef.datasource("out8", "out,8,*");
! gDef.area("in8", Color.GREEN, "input traffic");
! gDef.line("out8", Color.BLUE, "output traffic\n");
! gDef.comment("\n");
! gDef.gprint("in8", "AVERAGE", "Average input: @7.2 @sbits/s");
! gDef.gprint("in8", "MAX", "Maximum input: @7.2 @Sbits/s\n");
! gDef.gprint("out8", "AVERAGE", "Average output:@7.2 @sbits/s");
! gDef.gprint("out8", "MAX", "Maximum output:@7.2 @Sbits/s\n");
! gDef.comment("\n");
! gDef.comment("Description on device: " + alias);
! gDef.comment("\n");
! gDef.comment("Graph from " + new Date(start * 1000L));
! gDef.comment("to " + new Date(stop * 1000L + 1));
return new RrdGraph(gDef);
} catch (RrdException e) {
|