From: <cob...@us...> - 2003-09-30 21:45:27
|
Update of /cvsroot/jrobin/src/jrobin/demo In directory sc8-pr-cvs1:/tmp/cvs-serv8118/src/jrobin/demo Modified Files: JRobinMinMaxDemo.java JRobinComplexGraph.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: JRobinMinMaxDemo.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/JRobinMinMaxDemo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JRobinMinMaxDemo.java 22 Sep 2003 17:15:17 -0000 1.2 --- JRobinMinMaxDemo.java 30 Sep 2003 21:45:22 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- import jrobin.graph.RrdGraphDef; + import java.io.*; import java.awt.*; import java.io.IOException; *************** *** 99,103 **** RrdGraph graph = new RrdGraph(gDef); //graph.saveAsPNG(pngFile, 550, 250); ! graph.saveAsPNG(pngFile, 0, 0); } --- 100,111 ---- RrdGraph graph = new RrdGraph(gDef); //graph.saveAsPNG(pngFile, 550, 250); ! //graph.saveAsPNG(pngFile, 0, 0); ! ! byte[] l = graph.getPNGBytes(0, 0); ! System.out.println(l.length); ! FileOutputStream fl = new FileOutputStream("/byte.png"); ! fl.write(l); ! fl.close(); ! } Index: JRobinComplexGraph.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/JRobinComplexGraph.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JRobinComplexGraph.java 25 Sep 2003 21:58:05 -0000 1.2 --- JRobinComplexGraph.java 30 Sep 2003 21:45:22 -0000 1.3 *************** *** 43,48 **** public static void main(String[] args) { ! GregorianCalendar start = new GregorianCalendar(2003, 7, 23, 00, 00); ! GregorianCalendar end = new GregorianCalendar(2003, 7, 24, 00, 00); RrdGraphDef gDef = new RrdGraphDef(); --- 43,49 ---- public static void main(String[] args) { ! GregorianCalendar start = new GregorianCalendar(2003, 7, 23, 0, 0); ! GregorianCalendar end = new GregorianCalendar(2003, 7, 24, 0, 0); ! RrdGraphDef gDef = new RrdGraphDef(); *************** *** 74,78 **** gDef.area("p75t90", new Color(0xff,0x66,0x00), "75 - 90%"); gDef.area("p90t100", new Color(0xcc,0x33,0x00), "90 - 100%"); ! gDef.rule(10.0, Color.YELLOW, null); gDef.gprint("busy", "AVERAGE", " Average:@5.1@s%"); gDef.gprint("busy", "LAST", "Current: @5.1@s%"); --- 75,79 ---- gDef.area("p75t90", new Color(0xff,0x66,0x00), "75 - 90%"); gDef.area("p90t100", new Color(0xcc,0x33,0x00), "90 - 100%"); ! gDef.rule(10.0, Color.ORANGE, null); gDef.gprint("busy", "AVERAGE", " Average:@5.1@s%"); gDef.gprint("busy", "LAST", "Current: @5.1@s%"); *************** *** 96,102 **** gDef.comment("-------------------------------------------------------------------------------@c"); gDef.comment("Generated: " + new Date() + "@r"); ! gDef.setBackColor( Color.WHITE ); gDef.setValueAxisLabel("server load"); ! // Create actual graph RrdGraph graph = new RrdGraph(gDef); --- 97,107 ---- gDef.comment("-------------------------------------------------------------------------------@c"); gDef.comment("Generated: " + new Date() + "@r"); ! //gDef.setBackColor( Color.ORANGE ); gDef.setValueAxisLabel("server load"); ! //gDef.setGridX( false ); ! //gDef.setGridY( false ); ! gDef.setImageBorder( Color.DARK_GRAY, 1 ); ! gDef.setFrontGrid(false); ! gDef.setShowLegend(true); // Create actual graph RrdGraph graph = new RrdGraph(gDef); *************** *** 114,118 **** gd.area("in", Color.GREEN, null); gd.line("out", Color.BLUE, null); ! RrdGraph graph2 = new RrdGraph(gd); graph2.saveAsPNG("/traff.png", 0, 0); --- 119,123 ---- gd.area("in", Color.GREEN, null); gd.line("out", Color.BLUE, null); ! gd.setRigidGrid(true); RrdGraph graph2 = new RrdGraph(gd); graph2.saveAsPNG("/traff.png", 0, 0); *************** *** 140,143 **** --- 145,149 ---- graph2 = new RrdGraph(gd); graph2.saveAsPNG("/ftp.png", 0, 0); + //graph.saveAsPNG("c:/demo.png", 495, 200); |