|
From: <sa...@us...> - 2003-10-15 14:16:05
|
Update of /cvsroot/jrobin/src/jrobin/demo
In directory sc8-pr-cvs1:/tmp/cvs-serv372/jrobin/demo
Modified Files:
JRobinDemo.java
Log Message:
better looking colors
Index: JRobinDemo.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/demo/JRobinDemo.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** JRobinDemo.java 15 Oct 2003 13:21:20 -0000 1.7
--- JRobinDemo.java 15 Oct 2003 14:16:00 -0000 1.8
***************
*** 190,210 ****
gDef.line("sun", Color.GREEN, "sun temp");
gDef.line("shade", Color.BLUE, "shade temp");
! gDef.line("median", Color.DARK_GRAY, "median value");
gDef.area("diff", Color.RED, "difference");
// gradient color areas
for(int i = GRADIENT_COLOR_STEPS - 1; i >= 1; i--) {
! gDef.area("diff" + i, new Color(255 * i / GRADIENT_COLOR_STEPS, 0, 0), null);
}
! gDef.line("sine", Color.CYAN, "sine function demo");
gDef.gprint("sun", "MAX", "\nmaxSun = @3@s");
gDef.gprint("sun", "AVERAGE", "avgSun = @3@S@r");
gDef.gprint("shade", "MAX", "maxShade = @3@s");
gDef.gprint("shade", "AVERAGE", "avgShade = @3@S@r");
RrdGraph graph = new RrdGraph(gDef);
println("==Graph created");
println("==Saving graph as PNG file " + pngPath);
! graph.saveAsPNG(pngPath, 600, 400);
println("==Saving graph as JPEG file " + jpegPath);
! graph.saveAsJPEG(jpegPath, 600, 400, 0.5F);
// demo ends
--- 190,212 ----
gDef.line("sun", Color.GREEN, "sun temp");
gDef.line("shade", Color.BLUE, "shade temp");
! gDef.line("median", Color.MAGENTA, "median value");
gDef.area("diff", Color.RED, "difference");
// gradient color areas
for(int i = GRADIENT_COLOR_STEPS - 1; i >= 1; i--) {
! gDef.area("diff" + i, new Color(255, 255 - 255 * i / GRADIENT_COLOR_STEPS, 0), null);
}
! gDef.line("sine", Color.CYAN, "sine");
gDef.gprint("sun", "MAX", "\nmaxSun = @3@s");
gDef.gprint("sun", "AVERAGE", "avgSun = @3@S@r");
gDef.gprint("shade", "MAX", "maxShade = @3@s");
gDef.gprint("shade", "AVERAGE", "avgShade = @3@S@r");
+ // create graph finally
+ // gDef.setValueRange(-1000, 1000);
RrdGraph graph = new RrdGraph(gDef);
println("==Graph created");
println("==Saving graph as PNG file " + pngPath);
! graph.saveAsPNG(pngPath, 400, 250);
println("==Saving graph as JPEG file " + jpegPath);
! graph.saveAsJPEG(jpegPath, 400, 250, 0.5F);
// demo ends
|