|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jrobin.graph.RrdExportDef
org.jrobin.graph.RrdGraphDef
public class RrdGraphDef
Class used to collect information for a JRobin graph. JRobin graphs have many options and this class has methods and properties to set them.
The JRobin graph package was designed to create graphs that have the same look as the RRDTool counter parts. Almost all the same graphing options are available, with some extra's like more advanced text alignment and custom point-to-point lines and area's.
To learn more about RDTool's graphs see RRDTool's rrdgraph man page. This man page is important: JRobin uses the same concept of graph sources definition (DEF directives) and supports RPN extensions in complex datasource definitions (RRDTool's CDEF directives).
RrdGraphDef
class does not actually create any graph. It just collects necessary information.
Graph will be created when you pass RrdGraphDef
object to a RrdGraph
, either
by passing it to the constructor or using the setGraphDef()
method.
Field Summary |
---|
Fields inherited from class org.jrobin.graph.RrdExportDef |
---|
cdefList, edefList, exportList, fetchSources, pdefList, STRICT_EXPLICIT_OFF, STRICT_EXPLICIT_ON, STRICT_IMPLICIT_OFF, STRICT_IMPLICIT_ON |
Constructor Summary | |
---|---|
RrdGraphDef()
Constructs a new default JRobin graph object. |
|
RrdGraphDef(java.util.Date start,
java.util.Date end)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
|
RrdGraphDef(java.util.GregorianCalendar start,
java.util.GregorianCalendar end)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
|
RrdGraphDef(long startTime,
long endTime)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
Method Summary | |
---|---|
void |
area(java.util.GregorianCalendar t1,
double v1,
java.util.GregorianCalendar t2,
double v2,
java.awt.Color color,
java.lang.String legend)
Adds area plot to the graph definition, based on two points. |
void |
area(java.lang.String sourceName,
java.awt.Color color,
java.lang.String legend)
Adds area plot to the graph definition, using the specified color and legend. |
void |
comment(java.lang.String text)
Adds comment to the graph definition. |
protected boolean |
drawFrontGrid()
|
void |
exportXmlTemplate(java.io.OutputStream stream)
Exports RrdGraphDef (graph definition) object in XML format to output stream. |
protected java.awt.Color |
getArrowColor()
|
protected java.awt.Color |
getAxisColor()
|
protected java.awt.Color |
getBackColor()
|
protected java.io.File |
getBackground()
|
protected double |
getBaseValue()
|
protected java.awt.Color |
getBorderColor()
|
protected java.awt.BasicStroke |
getBorderStroke()
|
protected java.awt.Color |
getCanvasColor()
|
protected int |
getChartLeftPadding()
|
protected int |
getCommentLineCount()
|
protected org.jrobin.graph.Comment[] |
getComments()
|
protected java.awt.Font |
getDefaultFont()
|
protected java.awt.Color |
getDefaultFontColor()
|
protected int |
getFirstDayOfWeek()
|
protected java.awt.Color |
getFrameColor()
|
protected org.jrobin.graph.GridRange |
getGridRange()
|
protected java.awt.Color |
getImageBorderColor()
|
protected java.awt.BasicStroke |
getImageBorderStroke()
|
protected java.awt.Color |
getMajorGridColor()
|
protected java.awt.Color |
getMinorGridColor()
|
protected java.io.File |
getOverlay()
|
protected org.jrobin.graph.PlotDef[] |
getPlotDefs()
|
protected int |
getScaleIndex()
|
protected TimeAxisUnit |
getTimeAxis()
|
protected org.jrobin.graph.Title |
getTitle()
|
protected java.awt.Font |
getTitleFont()
|
protected java.awt.Color |
getTitleFontColor()
|
protected org.jrobin.graph.ValueAxisUnit |
getValueAxis()
|
protected java.lang.String |
getVerticalLabel()
|
void |
gprint(java.lang.String sourceName,
java.lang.String consolFun,
java.lang.String format)
Calculate the chosen consolidation function consolFun over
the graph sourceName and prints the result
on the graph using the specified format string. |
void |
gprint(java.lang.String sourceName,
java.lang.String consolFun,
java.lang.String format,
double base)
See the gprint() method for more details. |
void |
hrule(double value,
java.awt.Color color,
java.lang.String legend)
Adds horizontal rule to the graph definition. |
void |
hrule(double value,
java.awt.Color color,
java.lang.String legend,
int lineWidth)
Adds horizontal rule to the graph definition. |
protected boolean |
isFrontGrid()
|
protected boolean |
isLazy()
|
void |
line(java.util.GregorianCalendar t1,
double v1,
java.util.GregorianCalendar t2,
double v2,
java.awt.Color color,
java.lang.String legend,
int lineWidth)
Adds line plot to the graph definition, based on two points. |
void |
line(java.lang.String sourceName,
java.awt.Color color,
java.lang.String legend)
Adds line plot to the graph definition, using the specified color and legend. |
void |
line(java.lang.String sourceName,
java.awt.Color color,
java.lang.String legend,
int lineWidth)
Adds line plot to the graph definition, using the specified color, legend and line width. |
void |
setAntiAliasing(boolean aa)
Set the anti-aliasing option for the drawing area of the graph. |
void |
setArrowColor(java.awt.Color c)
Determines the color of the small axis arrow on the chart X axis. |
void |
setAxisColor(java.awt.Color c)
Determines the color of chart X axis. |
void |
setBackColor(java.awt.Color backColor)
Sets image background color. |
void |
setBackground(java.lang.String fileName)
Sets a background image to use for the graph. |
void |
setBaseValue(double base)
Sets the base for value scaling. |
void |
setCanvasColor(java.awt.Color canvasColor)
Sets chart area background color. |
void |
setChartLeftPadding(int lp)
Set the number of pixels on the left of the chart area ( value marker space ). |
void |
setDefaultFont(java.awt.Font f)
Sets the default font to be used in the graph as a java.awt.Font object. |
void |
setDefaultFontColor(java.awt.Color c)
Sets the color of the default font used in the graph as a java.awt.Color object. |
void |
setFirstDayOfWeek(int day)
Sets the first day of a calendar week, defaults to monday if not set. |
void |
setFrameColor(java.awt.Color c)
Determines the color of chart area frame. |
void |
setFrontGrid(boolean frontGrid)
Determine if the graph grid is in front of the chart itself, or behind it. |
void |
setGridRange(double lower,
double upper,
boolean rigid)
Sets value range that will be presented in the graph. |
void |
setGridX(boolean visible)
Determines if the X axis grid should be drawn. |
void |
setGridY(boolean visible)
Determines if the Y axis grid should be drawn. |
void |
setImageBorder(java.awt.Color c,
int w)
Specifies the settings of the image border. |
void |
setLazy(boolean lazyGeneration)
Sets the 'lazy' flag for this GraphDef. |
void |
setLowerLimit(double lower)
This sets the lower limit of the grid to the specified value, see setGridRange(double, double, boolean) . |
void |
setMajorGridColor(java.awt.Color c)
Sets the color of the chart's major grid. |
void |
setMajorGridX(boolean visible)
Determines if the major grid with labels for the X axis needs to be drawn. |
void |
setMajorGridY(boolean visible)
Determines if the major grid with labels for the Y axis needs to be drawn. |
void |
setMinorGridColor(java.awt.Color c)
Determines the color of chart's the minor grid. |
void |
setMinorGridX(boolean visible)
Determines if the minor grid for the X axis needs to be drawn. |
void |
setMinorGridY(boolean visible)
Determines if the minor grid for the Y axis needs to be drawn. |
void |
setOverlay(java.lang.String fileName)
Sets a overlay image to use for the graph. |
void |
setShowLegend(boolean showLegend)
Determine if the legend should be visible or not, default: visible. |
void |
setShowSignature(boolean showSignature)
Determine if the default JRobin signature should be visible, default: yes. |
void |
setTimeAxis(int minGridTimeUnit,
int minGridUnitSteps,
int majGridTimeUnit,
int majGridUnitSteps,
java.lang.String dateFormat,
boolean centerLabels)
This sets the grid and labels on the X axis. |
void |
setTimeAxisLabel(java.lang.String label)
Sets horizontal (time) axis label. |
void |
setTitle(java.lang.String title)
Sets graph title. |
void |
setTitleFont(java.awt.Font f)
Sets the font to be used for the graph title as a java.awt.Font object. |
void |
setTitleFontColor(java.awt.Color c)
Sets the color of the title font used in the graph as a java.awt.Color object. |
void |
setUnitsExponent(int e)
This sets the 10** exponent scaling of the Y-axis values. |
void |
setValueAxis(double gridStep,
double labelStep)
This sets the grid and labels on the Y axis. |
void |
setVerticalLabel(java.lang.String label)
Sets vertical (value) axis label. |
protected boolean |
showGridX()
|
protected boolean |
showGridY()
|
protected boolean |
showLegend()
|
protected boolean |
showMajorGridX()
|
protected boolean |
showMajorGridY()
|
protected boolean |
showMinorGridX()
|
protected boolean |
showMinorGridY()
|
protected boolean |
showSignature()
|
void |
stack(java.lang.String sourceName,
java.awt.Color color,
java.lang.String legend)
Adds stacked plot to the graph definition, using the specified color and legend. |
void |
time(java.lang.String text,
java.text.DateFormat format)
Adds a comment that will contain the current time, to the graph definition. |
void |
time(java.lang.String text,
java.text.DateFormat format,
java.util.Calendar cal)
Adds a comment that will contain the given timestamp, to the graph definition. |
void |
time(java.lang.String text,
java.text.DateFormat format,
java.util.Date date)
Adds a comment that will contain the given timestamp, to the graph definition. |
void |
time(java.lang.String text,
java.text.DateFormat format,
long timestamp)
Adds a comment that will contain the given timestamp, to the graph definition. |
void |
time(java.lang.String text,
java.lang.String pattern)
Adds a comment that will contain the current time, to the graph definition. |
void |
time(java.lang.String text,
java.lang.String pattern,
java.util.Calendar cal)
Adds a comment that will contain the given timestamp, to the graph definition. |
void |
time(java.lang.String text,
java.lang.String pattern,
java.util.Date date)
Adds a comment that will contain the given timestamp, to the graph definition. |
void |
time(java.lang.String text,
java.lang.String pattern,
long timestamp)
Adds a comment that will contain the given timestamp, to the graph definition. |
protected boolean |
useAntiAliasing()
|
void |
vrule(java.util.GregorianCalendar timestamp,
java.awt.Color color,
java.lang.String legend)
Adds a vertical rule to the graph definition. |
void |
vrule(java.util.GregorianCalendar timestamp,
java.awt.Color color,
java.lang.String legend,
int lineWidth)
Adds a vertical rule to the graph definition. |
Methods inherited from class org.jrobin.graph.RrdExportDef |
---|
addExportData, datasource, datasource, datasource, datasource, datasource, datasource, datasource, export, export, exportXmlTemplate, exportXmlTemplate, getCdefs, getEndTime, getExportData, getExportDatasources, getFetchSources, getNumDefs, getNumSdefs, getPdefs, getResolution, getStartTime, getXmlTemplate, isStrict, setDatasources, setResolution, setStrictExport, setTimePeriod, setTimePeriod, setTimePeriod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RrdGraphDef()
public RrdGraphDef(long startTime, long endTime) throws RrdException
startTime
- Starting timestamp in seconds.endTime
- Ending timestamp in seconds.
RrdException
- Thrown if invalid parameters are supplied.public RrdGraphDef(java.util.Date start, java.util.Date end) throws RrdException
java.util.Date
objects.
start
- Starting time.end
- Ending time.
RrdException
- Thrown in case of invalid parameters.public RrdGraphDef(java.util.GregorianCalendar start, java.util.GregorianCalendar end) throws RrdException
java.util.GregorianCalendar
objects.
start
- Starting time.end
- Ending time.
RrdException
- Thrown in case of invalid parameters.Method Detail |
---|
public void setLazy(boolean lazyGeneration)
lazyGeneration
- True if the script should only generate.public void setTitle(java.lang.String title) throws RrdException
title
- Graph title.
RrdException
public void setVerticalLabel(java.lang.String label)
label
- Vertical axis label.public void setTimeAxisLabel(java.lang.String label) throws RrdException
A horizontal axis label is always center aligned by default, with an extra linefeed to add some space before the regular comment lines start. If you wish to remove the extra line of whitespace you should specify the alignment in the label using @c, @l or @r. Using the @C, @L or @R markers will align the text appropriately, and leave the extra line of whitespace intact.
It is possible to use multiple lines and multiple alignment markers for the axis label, in that case you should specify alignment for every part of the label to get it to display correctly. When using multiple lines, no markers will be added to the end of the last line by default.
label
- Horizontal axis label.
RrdException
public void setBackColor(java.awt.Color backColor)
backColor
- Graph background color.public void setCanvasColor(java.awt.Color canvasColor)
canvasColor
- Chart area background color.public void setImageBorder(java.awt.Color c, int w)
c
- Bordercolor of the image.w
- Pixel width of the image border.public void setTitleFontColor(java.awt.Color c)
java.awt.Color
object.
Default title font color is black.
c
- The color to be used.public void setDefaultFontColor(java.awt.Color c)
java.awt.Color
object.
Default font color is black.
c
- The color to be used.public void setTitleFont(java.awt.Font f)
java.awt.Font
object.
Default title font is "Lucida Sans Typewriter", with BOLD attributes and a size of 12 points.
f
- The Font to be used.public void setDefaultFont(java.awt.Font f)
java.awt.Font
object.
Default font is "Lucida Sans Typewriter", with PLAIN attributes and a size of 10 points.
f
- The Font to be used.public void setMajorGridColor(java.awt.Color c)
c
- Color to use.public void setMinorGridColor(java.awt.Color c)
c
- Color to use.public void setFrameColor(java.awt.Color c)
c
- Color to use.public void setAxisColor(java.awt.Color c)
c
- Color to use.public void setArrowColor(java.awt.Color c)
c
- Color to use.public void setMinorGridX(boolean visible)
visible
- True if minor grid needs to be drawn, false if not.public void setMinorGridY(boolean visible)
visible
- True if minor grid needs to be drawn, false if not.public void setMajorGridX(boolean visible)
visible
- True if major grid needs to be drawn, false if not.public void setMajorGridY(boolean visible)
visible
- True if major grid needs to be drawn, false if not.public void setGridX(boolean visible)
visible
- True if grid needs to be drawn, false if not.public void setGridY(boolean visible)
visible
- True if grid needs to be drawn, false if not.public void setFrontGrid(boolean frontGrid)
frontGrid
- True if the grid is in front of the chart.public void setShowLegend(boolean showLegend)
showLegend
- True if the legend is visible.public void setShowSignature(boolean showSignature)
showSignature
- True if the signature is visible.public void setAntiAliasing(boolean aa)
aa
- True if anti-aliasing is on, false if offpublic void setChartLeftPadding(int lp)
lp
- Number of pixels used, defaults to 50.public void setBackground(java.lang.String fileName)
fileName
- Filename of the image to usepublic void setOverlay(java.lang.String fileName)
fileName
- Filename of the image to usepublic void setBaseValue(double base)
base
- Value to set as base for scaling.public void setUnitsExponent(int e)
e
- Exponent value to usepublic void setGridRange(double lower, double upper, boolean rigid)
lower
- Lower limit.upper
- Upper limit.rigid
- Rigid grid, won't autoscale limits.public void setLowerLimit(double lower)
setGridRange(double, double, boolean)
.
This is the equivalent of: setGridRange( lower, Double.NaN, false );
lower
- Lower limit.public void setValueAxis(double gridStep, double labelStep)
gridStep
, major grid lines accompanied by a label
will appear every labelStep
value.
gridStep
- Value step on which a minor grid line will appear.labelStep
- Value step on which a major grid line with value label will appear.public void setTimeAxis(int minGridTimeUnit, int minGridUnitSteps, int majGridTimeUnit, int majGridUnitSteps, java.lang.String dateFormat, boolean centerLabels)
TimeAxisUnit
class, and are SECOND, MINUTE, HOUR, DAY,
WEEK, MONTH and YEAR.
minGridTimeUnit
- Time unit for the minor grid lines.minGridUnitSteps
- Time unit steps for the minor grid lines.majGridTimeUnit
- Time unit for the major grid lines.majGridUnitSteps
- Time unit steps for the major grid lines.dateFormat
- Format string of the time labels, according to java.text.SimpleDateFormat
specifications.centerLabels
- True if the time label should be centered in the area between two major grid lines.public void setFirstDayOfWeek(int day)
day
- Weekday, 0 for sunday, 6 for saturday.public void line(java.lang.String sourceName, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
sourceName
- Graph source name.color
- Line collor to be used.legend
- Legend to be printed on the graph.
RrdException
- Thrown if invalid graph source name is supplied.public void line(java.lang.String sourceName, java.awt.Color color, java.lang.String legend, int lineWidth) throws RrdException
gprint
or comment
.
sourceName
- Graph source name.color
- Line color to be used.legend
- Legend to be printed on the graph.lineWidth
- Width of the line in pixels.
RrdException
- Thrown if invalid graph source name is supplied.public void line(java.util.GregorianCalendar t1, double v1, java.util.GregorianCalendar t2, double v2, java.awt.Color color, java.lang.String legend, int lineWidth) throws RrdException
gprint
or comment
.
t1
- Timestamp (X axis) of the start point of the line.v1
- Value (Y axis) of the start point of the line.t2
- Timestamp (X axis) of the end point of the line.v2
- Value (Y axis) of the end point of the line.color
- Line color to be used.legend
- Legend to be printed on the graph.lineWidth
- Width of the line in pixels.
RrdException
- Thrown if invalid graph source name is supplied.public void area(java.lang.String sourceName, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
sourceName
- Graph source name.color
- Filling collor to be used for area plot.legend
- Legend to be printed on the graph.
RrdException
- Thrown if invalid graph source name is supplied.public void area(java.util.GregorianCalendar t1, double v1, java.util.GregorianCalendar t2, double v2, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
t1
- Timestamp (X axis) of the bottom-left corner of the area.v1
- Value (Y axis) of the bottom-left corner of the area.t2
- Timestamp (X axis) of the upper-right corner of the area.v2
- Value (Y axis) of the upper-right corner of the area.color
- Filling collor to be used for area plot.legend
- Legend to be printed on the graph.
RrdException
- Thrown if invalid graph source name is supplied.public void stack(java.lang.String sourceName, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
sourceName
- Graph source name.color
- Collor to be used.legend
- Legend to be printed on the graph.
RrdException
- Thrown if invalid graph source name is supplied.public void hrule(double value, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
value
- Rule posiotion.color
- Rule color.legend
- Legend to be added to the graph.
RrdException
- Thrown in case of JRobin specific error.public void hrule(double value, java.awt.Color color, java.lang.String legend, int lineWidth) throws RrdException
gprint
or comment
.
value
- Rule posiotion.color
- Rule color.legend
- Legend to be added to the graph.lineWidth
- Width of the hrule line in pixels.
RrdException
- Thrown in case of JRobin specific error.public void vrule(java.util.GregorianCalendar timestamp, java.awt.Color color, java.lang.String legend) throws RrdException
gprint
or comment
.
timestamp
- Rule position (specific moment in time)color
- Rule color.legend
- Legend to be added to the graph.
RrdException
public void vrule(java.util.GregorianCalendar timestamp, java.awt.Color color, java.lang.String legend, int lineWidth) throws RrdException
gprint
or comment
.
timestamp
- Rule position (specific moment in time)color
- Rule color.legend
- Legend to be added to the graph.lineWidth
- Width of the vrule in pixels.
RrdException
public void comment(java.lang.String text) throws RrdException
@l
, @c
or @r
,
respectively. It is also possible to align text without adding a linefeed by using
@L
, @R
and @C
as markers. After a GPRINT some
whitespace is appended by default. To suppress this whitespace put a @G
marker at the very end of the string. By putting a @g
marker instead all
whitespace inside the string at very beginning or end will be removed also.
text
- Comment
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.lang.String pattern) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the pattern parameter, for information
on possible patterns, see java.text.SimpleDateFormat.
text
- Comment text (must contain @t marker).pattern
- SimpleDateFormat pattern to format the timestamp with.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.text.DateFormat format) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the DateFormat passed as a parameter.
text
- Comment text (must contain @t marker).format
- DateFormat object to format the timestamp with.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.lang.String pattern, long timestamp) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the pattern parameter, for information
on possible patterns, see java.text.SimpleDateFormat.
text
- Comment text (must contain @t marker).pattern
- SimpleDateFormat pattern to format the timestamp with.timestamp
- Timestamp (in seconds) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.text.DateFormat format, long timestamp) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the DateFormat passed as a parameter.
text
- Comment text (must contain @t marker).format
- DateFormat object to format the timestamp with.timestamp
- Timestamp (in seconds) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.lang.String pattern, java.util.Date date) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the pattern parameter, for information
on possible patterns, see java.text.SimpleDateFormat.
text
- Comment text (must contain @t marker).pattern
- SimpleDateFormat pattern to format the timestamp with.date
- Timestamp (as Date object) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.text.DateFormat format, java.util.Date date) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the DateFormat passed as a parameter.
text
- Comment text (must contain @t marker).format
- DateFormat object to format the timestamp with.date
- Timestamp (as Date object) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.lang.String pattern, java.util.Calendar cal) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the pattern parameter, for information
on possible patterns, see java.text.SimpleDateFormat.
text
- Comment text (must contain @t marker).pattern
- SimpleDateFormat pattern to format the timestamp with.cal
- Timestamp (as Calendar) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void time(java.lang.String text, java.text.DateFormat format, java.util.Calendar cal) throws RrdException
@t
should be present for the location of the timestamp.
The actual format of the printed timestamp is determined by the DateFormat passed as a parameter.
text
- Comment text (must contain @t marker).format
- DateFormat object to format the timestamp with.cal
- Timestamp (as Calendar) that should be formatted.
RrdException
- Thrown in case of JRobin specific error.public void gprint(java.lang.String sourceName, java.lang.String consolFun, java.lang.String format) throws RrdException
Calculate the chosen consolidation function consolFun
over
the graph sourceName
and prints the result
on the graph using the specified format
string.
In the format string there should be a
@n
marker (replace n
with the desired number of decimals)
in the place where the number should be printed. If an additional @s
is
found in the format, the value will be scaled and an appropriate SI magnitude
unit will be printed in place of the @s
marker. If you specify
@S
instead of @s
, the value will be scaled with the scale
factor used in the last gprint directive (uniform value scaling).
The text printed on the graph will be left, center or right aligned
if the format string ends with @l
, @c
or @r
,
respectively. It is also possible to align text without adding a linefeed by using
@L
, @R
and @C
as markers. After a GPRINT some
whitespace is appended by default. To suppress this whitespace put a @G
marker at the very end of the string. By putting a @g
marker instead all
whitespace inside the string at very beginning or end will be removed also.
sourceName
- Graph source nameconsolFun
- Consolidation function to be used for calculation ("AVERAGE",
"MIN", "MAX", "LAST" or "TOTAL" (since 1.3.1)format
- Format string. For example: "speed is @5.2 @sbits/sec@c",
"temperature = @0 degrees"
RrdException
- Thrown in case of JRobin specific errorpublic void gprint(java.lang.String sourceName, java.lang.String consolFun, java.lang.String format, double base) throws RrdException
See the gprint()
method for more details.
This gprint implementation allows a specific base value to be specified for this particular gprint only, the specified
base value can be different than the global base value used through the entire graph for the drawing. The resulting value of the gprint
will be formatted according to the specified base value.
sourceName
- Graph source nameconsolFun
- Consolidation function to be used for calculation ("AVERAGE", "MIN", "MAX", "LAST"
or "TOTAL" (since 1.3.1)format
- Format string. For example: "speed is @5.2 @sbits/sec@c", "temperature = @0 degrees"base
- Base value for the formatting, defaults to the graphing base value
RrdException
- Thrown in case of JRobin specific errorpublic void exportXmlTemplate(java.io.OutputStream stream)
RrdGraphDefTemplate
class.
exportXmlTemplate
in class RrdExportDef
stream
- Output stream to send XML code toprotected boolean isLazy()
protected org.jrobin.graph.Title getTitle()
protected java.lang.String getVerticalLabel()
protected java.awt.Color getBackColor()
protected java.awt.Color getCanvasColor()
protected java.awt.Color getImageBorderColor()
protected java.awt.BasicStroke getImageBorderStroke()
protected java.awt.Color getTitleFontColor()
protected java.awt.Color getDefaultFontColor()
protected java.awt.Font getTitleFont()
protected java.awt.Font getDefaultFont()
protected java.awt.Color getMajorGridColor()
protected java.awt.Color getMinorGridColor()
protected java.awt.Color getFrameColor()
protected java.awt.Color getAxisColor()
protected java.awt.Color getArrowColor()
protected java.awt.Color getBorderColor()
protected java.awt.BasicStroke getBorderStroke()
protected boolean showMinorGridX()
protected boolean showMinorGridY()
protected boolean showMajorGridX()
protected boolean showMajorGridY()
protected boolean showGridX()
protected boolean showGridY()
protected boolean drawFrontGrid()
protected boolean showLegend()
protected boolean showSignature()
protected boolean isFrontGrid()
protected boolean useAntiAliasing()
protected int getChartLeftPadding()
protected java.io.File getBackground()
protected java.io.File getOverlay()
protected double getBaseValue()
protected int getScaleIndex()
protected org.jrobin.graph.GridRange getGridRange()
protected org.jrobin.graph.ValueAxisUnit getValueAxis()
protected TimeAxisUnit getTimeAxis()
protected int getFirstDayOfWeek()
protected org.jrobin.graph.PlotDef[] getPlotDefs()
protected org.jrobin.graph.Comment[] getComments()
protected int getCommentLineCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |