From: Arne V. <cob...@us...> - 2004-07-27 12:30:31
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16033/org/jrobin/graph Modified Files: ExportData.java Grapher.java RrdExportDefTemplate.java RrdGraphDefTemplate.java ValueAxisUnit.java Log Message: JRobin 1.4.0 - Updated Javadoc - Value grid tweaking Index: Grapher.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/Grapher.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Grapher.java 19 Jul 2004 21:12:27 -0000 1.19 --- Grapher.java 27 Jul 2004 12:30:17 -0000 1.20 *************** *** 662,666 **** { int valRel = chartGraph.getY( valueList[i].getValue() ); ! valueFormat.setFormat( valueList[i].getValue(), 2, 0 ); String label = (valueFormat.getScaledValue() + " " + valueFormat.getPrefix()).trim(); --- 662,666 ---- { int valRel = chartGraph.getY( valueList[i].getValue() ); ! valueFormat.setFormat( valueList[i].getValue(), 2, 0 ); String label = (valueFormat.getScaledValue() + " " + valueFormat.getPrefix()).trim(); Index: ValueAxisUnit.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/ValueAxisUnit.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ValueAxisUnit.java 10 Jul 2004 00:07:03 -0000 1.7 --- ValueAxisUnit.java 27 Jul 2004 12:30:17 -0000 1.8 *************** *** 82,104 **** ValueMarker[] getValueMarkers( double lower, double upper ) { ! double minPoint = 0.0d; ! double majPoint = 0.0d; // Find the first visible gridpoint ! if ( lower > 0 ) { ! while ( minPoint < lower ) minPoint += gridStep; ! while ( majPoint < lower ) majPoint += labelStep; ! } else { ! while ( minPoint > lower ) minPoint -= gridStep; ! while ( majPoint > lower ) majPoint -= labelStep; ! // Go one up to make it visible ! if (minPoint != lower ) minPoint += gridStep; ! if (majPoint != lower ) majPoint += labelStep; } ! ! // Now get all time markers. ! // Again we choose to use a series of loops as to avoid unnecessary drawing. ArrayList markerList = new ArrayList(); ! while ( minPoint <= upper && majPoint <= upper ) { --- 82,114 ---- ValueMarker[] getValueMarkers( double lower, double upper ) { ! double minPoint = 0.0; ! double majPoint = 0.0; // Find the first visible gridpoint ! if ( lower > 0 ) ! { ! minPoint = lower; ! double mod = ( lower % labelStep ); ! ! if ( mod > 0 ) ! majPoint = lower + (labelStep - mod ); ! else ! majPoint = lower; } ! else if ( lower < 0 ) ! { ! minPoint = lower; ! double mod = ( lower % labelStep ); ! ! if ( Math.abs(mod) > 0 ) ! majPoint = lower - mod; ! else ! majPoint = lower; ! } ! ! // Now get all value markers. ! // Again we choose to use a series of loops as to avoid unnecessary drawing. ArrayList markerList = new ArrayList(); ! while ( minPoint <= upper && majPoint <= upper ) { *************** *** 106,110 **** { markerList.add( new ValueMarker(minPoint, false) ); ! minPoint = round( minPoint + gridStep ); } else --- 116,120 ---- { markerList.add( new ValueMarker(minPoint, false) ); ! minPoint = round( minPoint + gridStep ); } else *************** *** 135,142 **** majPoint = round( majPoint + labelStep ); } ! return (ValueMarker[]) markerList.toArray( new ValueMarker[0] ); } ! /** * Gets a rounded value that's slightly below the given exact value. --- 145,152 ---- majPoint = round( majPoint + labelStep ); } ! return (ValueMarker[]) markerList.toArray( new ValueMarker[0] ); } ! /** * Gets a rounded value that's slightly below the given exact value. Index: ExportData.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/ExportData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExportData.java 13 Jul 2004 12:13:13 -0000 1.4 --- ExportData.java 27 Jul 2004 12:30:17 -0000 1.5 *************** *** 196,199 **** --- 196,200 ---- /** * Returns the step with which this data was fetched. + * * @return Step as long. */ Index: RrdGraphDefTemplate.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraphDefTemplate.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RrdGraphDefTemplate.java 20 Jul 2004 16:51:27 -0000 1.10 --- RrdGraphDefTemplate.java 27 Jul 2004 12:30:17 -0000 1.11 *************** *** 96,101 **** * <date_format>HH:mm</date_format> * <center_labels>true</center_labels> ! * <!-- ALLOWED DAYS OF WEEK: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY --> ! * <first_day_of_week>MONDAY</first_day_of_week> * </time_axis> * <time_axis_label>time</time_axis_label> --- 96,101 ---- * <date_format>HH:mm</date_format> * <center_labels>true</center_labels> ! * <!-- ALLOWED DAYS OF WEEK: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY --> ! * <first_day_of_week>MONDAY</first_day_of_week> * </time_axis> * <time_axis_label>time</time_axis_label> *************** *** 126,129 **** --- 126,130 ---- * <source>outOctets</source> * <cf>MAX</cf> + * <backend>FILE</backend> * </def> * <def> *************** *** 135,138 **** --- 136,155 ---- * <rpn>output,8,*,-1,*</rpn> * </def> + * <def> + * <name>avgOutput8</name> + * <datasource>output8</datasource> + * <cf>AVERAGE</cf> + * </def> + * <export_data> + * <file>exportdata1.xml</file> + * <ds_name_prefix>traffic</ds_name_prefix> + * </export_data> + * <export_data> + * <file>exportdata2.xml</file> + * <use_legend_names>true</use_legend_names> + * </export_data> + * <export_data> + * <file>exportdata3.xml</file> + * </export_data> * </datasources> * <graph> *************** *** 204,207 **** --- 221,233 ---- * <width>6</width> * </vrule> + * <time> + * <format>Current time: @t</format> + * <pattern>MMM dd, yyyy HH:mm:ss</pattern> + * </time> + * <time> + * <format>Month: @t</format> + * <pattern>MMMM yyyy</pattern> + * <value>2004-01-01 12:00:00</value> + * </time> * <comment>Created with JRobin</comment> * </graph> *************** *** 215,219 **** * <li>hard-coded timestamps in templates should be long integeres * (like: 1000243567) or ISO formatted strings (like: 2004-02-21 12:25:45) ! * <li>whitespaces are not harmful * <li>use <code>true</code>, <code>on</code>, <code>yes</code>, <code>y</code>, * or <code>1</code> to specify boolean <code>true</code> value (anything else will --- 241,247 ---- * <li>hard-coded timestamps in templates should be long integeres * (like: 1000243567) or ISO formatted strings (like: 2004-02-21 12:25:45) ! * <li>whitespaces are not harmful, however, whitespaces do get special treatment in case of printed text: it is not ! * necessary to use CDATA blocks to specify fixed whitespace with <code>comment</code>,<code>title</code>, <code>time</code>, ! * <code>gprint</code> or <code>legend</code> tags * <li>use <code>true</code>, <code>on</code>, <code>yes</code>, <code>y</code>, * or <code>1</code> to specify boolean <code>true</code> value (anything else will Index: RrdExportDefTemplate.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdExportDefTemplate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RrdExportDefTemplate.java 13 Jul 2004 12:13:13 -0000 1.2 --- RrdExportDefTemplate.java 27 Jul 2004 12:30:17 -0000 1.3 *************** *** 36,43 **** /** ! * <p>Class used to create an arbitrary number of RrdExportDef (export) objects * from a single XML template. XML template can be supplied as an XML InputSource, * XML file or XML formatted string.<p> * * @author Arne Vandamme (arn...@jr...) */ --- 36,94 ---- /** ! * <p>Class used to create a RrdExportDef (export) object * from a single XML template. XML template can be supplied as an XML InputSource, * XML file or XML formatted string.<p> * + * <p>Below is an exmple XML template, not all options are required:</p> + * + * <xmp> + * <rrd_export_def> + * <span> + * <start>${start}</start> + * <end>${end}</end> + * </span> + * <options> + * <resolution>300</resolution> + * <strict_export>true</strict_export> + * </options> + * <datasources> + * <def> + * <name>bytesIn</name> + * <rrd>${rrd}</rrd> + * <source>ifInOctets</source> + * <cf>AVERAGE</cf> + * </def> + * <def> + * <name>bytesOut</name> + * <rrd>${rrd}</rrd> + * <source>ifOutOctets</source> + * <cf>AVERAGE</cf> + * </def> + * <def> + * <name>bitsIn</name> + * <rpn>bytesIn,8,*</rpn> + * </def> + * <def> + * <name>bitsOut</name> + * <rpn>bytesOut,8,*</rpn> + * </def> + * </datasources> + * <exports> + * <export> + * <datasource>bitsIn</datasource> + * <legend>Incoming traffic</legend> + * </export> + * <export> + * <datasource>bitsOut</datasource> + * <legend>Outgoing traffic</legend> + * </export> + * </exports> + * </rrd_export_def> + * </xmp> + * + * <p><b>Note:</b> for more information on JRobin XML templates in general, refer to the {@link RrdGraphDefTemplate}</p> + * <p><b>Note:</b> the <code>RrdExportDefTemplate</code> <code>datasources</code> section can contain all the same options + * as the corresponding section in {@link RrdGraphDefTemplate} + * </p> * @author Arne Vandamme (arn...@jr...) */ |