- All Known Implementing Classes:
Axis, CommentText, LegendComposer, LegendText, PrintText, RrdGraph, RrdGraphDef, TimeAxis, ValueAxis, ValueAxisLogarithmic, ValueAxisMrtg
The fonts settings can be changed use some on the following properties, sorted by increased priority.
org.rrd4j.fonts.propertiesorg.rrd4j.fonts.properties.urlorg.rrd4j.font.plainorg.rrd4j.font.boldorg.rrd4j.font.plain.urlorg.rrd4j.font.bold.url
org.rrd4j.fonts.properties or org.rrd4j.fonts.properties.url is used, the file provided contains any other property of lower priority . The last four properties defines directly the plain or bold font. All properties URL related (
org.rrd4j.fonts.url, org.rrd4j.font.plain.url and
org.rrd4j.font.bold.url) download data from an URL. They are useful when those data are provided by the file system, defined by the OS. The others search for the data in the classpath. So it's easy to provided font-pack as a jar that's put before RRD44J's jar.The default settings uses org.rrd4j.fonts.properties looking for the file
/rrd4jfonts.properties in the classpath.
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFont constructor, to use embedded fonts.static enumAllowed font tag names which can be used inRrdGraphDef.setFont(org.rrd4j.graph.RrdGraphConstants.FontTag, java.awt.Font)methodField Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorAn transparent colorstatic final intIndex of the arrow color.static final intIndex of the background color.static final intIndex of the canvas color.static final intIndex of the font color.static final intIndex of the frame color.static final intIndex of the minor grid color.static final intIndex of the major grid color.static final intIndex of the top-left graph shade color.static final intIndex of the bottom-right graph shade color.static final intIndex of the x-axis color.static final intIndex of the yaxis color.static final intConstant to represent daystatic final ColorDefault arrow colorstatic final ColorDefault graph background colorstatic final doubleDefault value basestatic final ColorDefault graph canvas colorstatic final StringDefault graph ending timestatic final ColorDefault font colorstatic final ColorDefault frame colorstatic final ColorDefault minor grid colorstatic final intDefault graph heightstatic final StringDefault image formatstatic final floatDefault image quality, used only for jpeg graphsstatic final FontDefault graph large fontstatic final ColorDefault major grid colorstatic final ColorDefault top-left graph shade colorstatic final ColorDefault bottom-right graph shade colorstatic final FontDefault graph small fontstatic final StringDefault graph starting timestatic final intDefault units lengthstatic final intDefault graph widthstatic final ColorDefault x-axis colorstatic final ColorDefault x-axis colorstatic final intDefault first day of the week (obtained from the default locale)static final RrdGraphConstants.FontTagAxis font tagstatic final RrdGraphConstants.FontTagDefault font tagstatic final RrdGraphConstants.FontTagLegend font tagstatic final RrdGraphConstants.FontTagTitle font tagstatic final RrdGraphConstants.FontTagUnit font tagstatic final RrdGraphConstants.FontTagWatermark font tagstatic final intConstant to represent Fridaystatic final FontFont for the Gatorstatic final StrokeStroke used to draw gridstatic final StringHH:mm time formatstatic final intConstant to represent hourstatic final StringConstant to represent in-memory image namestatic final doubleUsed internallystatic final doubleUsed internallystatic final intUsed internallystatic final doubleUsed internallystatic final doubleUsed internallystatic final intConstant to represent minutestatic final intConstant to represent Mondaystatic final intConstant to represent monthstatic final intUsed internallystatic final intUsed internallystatic final doubleUsed internallystatic final intUsed internallystatic final intUsed internallystatic final intUsed internallystatic final intUsed internallystatic final intUsed internallystatic final StringThe name of the bold font, used to define theDEFAULT_LARGE_FONT.static final StringA URL to the bold font, used to define theDEFAULT_LARGE_FONT.static final StringThe name of the plain font, used to define theDEFAULT_SMALL_FONTand theGATOR_FONT.static final StringA URL to the plain font, used to define theDEFAULT_SMALL_FONTand theGATOR_FONT.static final StringThe file that contains font configuration searched in the class path.static final StringA possible URL to a configuration file.static final intConstant to represent Saturdaystatic final intConstant to represent secondstatic final floatInk length of one dot in a series line, in device pixels.static final intConstant to represent Sundaystatic final intConstant to represent Thursdaystatic final StrokeStroke used to draw ticksstatic final intConstant to represent Tuesdaystatic final intConstant to represent Wednesdaystatic final intConstant to represent weekstatic final intConstant to represent yearMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic StrokegridStroke(float width, float dashLength, float dashGap) The stroke a gridline is drawn with.static floatminimumDashGap(float dot, float width) The smallest gap that keeps consecutive dots from touching at the given stroke width.static StrokeseriesStroke(int seriesCount, float width) AsseriesStroke(int, float, float), at the default dot length.static StrokeseriesStroke(int seriesCount, float width, float dashLength) AsseriesStroke(int, float, float, float), at the default dot length and a derived gap.static StrokeseriesStroke(int seriesCount, float width, float dashLength, float dashGap) The stroke a plotted series is drawn with.
Field Details
DEFAULT_START
DEFAULT_END
HH_MM
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH
YEAR
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
COLOR_CANVAS
static final int COLOR_CANVASIndex of the canvas color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_BACK
static final int COLOR_BACKIndex of the background color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_SHADEA
static final int COLOR_SHADEAIndex of the top-left graph shade color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_SHADEB
static final int COLOR_SHADEBIndex of the bottom-right graph shade color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_GRID
static final int COLOR_GRIDIndex of the minor grid color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_MGRID
static final int COLOR_MGRIDIndex of the major grid color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_FONT
static final int COLOR_FONTIndex of the font color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_FRAME
static final int COLOR_FRAMEIndex of the frame color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_ARROW
static final int COLOR_ARROWIndex of the arrow color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_XAXIS
static final int COLOR_XAXISIndex of the x-axis color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
COLOR_YAXIS
static final int COLOR_YAXISIndex of the yaxis color. Used inRrdGraphDef.setColor(int, java.awt.Paint)- See Also:
FIRST_DAY_OF_WEEK
static final int FIRST_DAY_OF_WEEKDefault first day of the week (obtained from the default locale)DEFAULT_CANVAS_COLOR
Default graph canvas colorDEFAULT_BACK_COLOR
Default graph background colorDEFAULT_SHADEA_COLOR
Default top-left graph shade colorDEFAULT_SHADEB_COLOR
Default bottom-right graph shade colorDEFAULT_GRID_COLOR
Default minor grid colorDEFAULT_MGRID_COLOR
Default major grid colorDEFAULT_FONT_COLOR
Default font colorDEFAULT_FRAME_COLOR
Default frame colorDEFAULT_ARROW_COLOR
Default arrow colorDEFAULT_XAXIS_COLOR
Default x-axis colorDEFAULT_YAXIS_COLOR
Default x-axis colorBLIND_COLOR
An transparent colorIN_MEMORY_IMAGE
Constant to represent in-memory image name- See Also:
DEFAULT_UNITS_LENGTH
DEFAULT_WIDTH
DEFAULT_HEIGHT
DEFAULT_IMAGE_FORMAT
DEFAULT_IMAGE_QUALITY
static final float DEFAULT_IMAGE_QUALITYDefault image quality, used only for jpeg graphs- See Also:
DEFAULT_BASE
PROPERTYFONTSPROPERTIES
The file that contains font configuration searched in the class path. The default value is/rrd4jfonts.properties- See Also:
PROPERTYFONTSURL
A possible URL to a configuration file.- See Also:
PROPERTYFONTPLAIN
The name of the plain font, used to define theDEFAULT_SMALL_FONTand theGATOR_FONT. To be found in the classpath.- See Also:
PROPERTYFONTBOLD
The name of the bold font, used to define theDEFAULT_LARGE_FONT. To be found in the classpath.- See Also:
PROPERTYFONTPLAINURL
A URL to the plain font, used to define theDEFAULT_SMALL_FONTand theGATOR_FONT.- See Also:
PROPERTYFONTBOLDURL
A URL to the bold font, used to define theDEFAULT_LARGE_FONT.- See Also:
DEFAULT_SMALL_FONT
Default graph small fontDEFAULT_LARGE_FONT
Default graph large fontGATOR_FONT
Font for the GatorLEGEND_LEADING
LEGEND_LEADING_SMALL
LEGEND_BOX_SPACE
LEGEND_BOX
LEGEND_INTERSPACING
PADDING_LEFT
PADDING_TOP
PADDING_TITLE
PADDING_RIGHT
PADDING_PLOT
PADDING_LEGEND
PADDING_BOTTOM
PADDING_VLABEL
GRID_STROKE
Stroke used to draw gridSERIES_DOT
static final float SERIES_DOTInk length of one dot in a series line, in device pixels.- See Also:
TICK_STROKE
Stroke used to draw ticksFONTTAG_DEFAULT
Default font tagFONTTAG_TITLE
Title font tagFONTTAG_AXIS
Axis font tagFONTTAG_UNIT
Unit font tagFONTTAG_LEGEND
Legend font tagFONTTAG_WATERMARK
Watermark font tag
Method Details
seriesStroke
The stroke a plotted series is drawn with.A graph carrying more than one series draws dotted; a graph with a single series draws solid. Dots are what separate two overlapping series, and a lone series has nothing to be separated from - dashing it only adds noise and makes the line look broken. Dots also help where two series of similar hue cross, which colour alone does not resolve.
The gap is derived from the stroke width rather than fixed, because a round cap extends each dot by half the width on both ends. With a one-on-one-off pattern a 1.5px line puts 2.5px of ink into a 2px period, so consecutive dots overlap and the line renders solid - dotted in the markup and not on screen. The gap has to exceed the width for the dots to stay separate at any weight; twice the width is the tightest that still leaves a visible space.
- Parameters:
seriesCount- how many independently plotted series the graph carrieswidth- requested line width in pixelsdashLength- ink length of one dot; zero draws a solid line, and negative values fall back toSERIES_DOTdashGap- space after the dot, as a CSS--graph_plotDashpair would state it. Values at or below zero, or too small to keep the dots apart, fall back to the derived gap.- Returns:
- a solid stroke for a lone series or a zero dot length, otherwise round dots
gridStroke
The stroke a gridline is drawn with.A zero dot length is a theme asking for solid gridlines, which is what they have always been; anything else is a dot-and-gap pattern, with the gap raised to
minimumDashGap(float, float)when a theme states one too small to keep the dots apart.- Parameters:
width- requested stroke width in pixelsdashLength- ink length of one dot; zero draws a solid linedashGap- space after the dot, or zero to derive it- Returns:
- the stroke to draw gridlines with
minimumDashGap
static float minimumDashGap(float dot, float width) The smallest gap that keeps consecutive dots from touching at the given stroke width.A round cap extends each dash by half the width on both ends, so one dot lays down
dot + widthof ink. Dots stay separate while the period exceeds that, which makeswidththe hard limit; twice the width is the tightest value that still leaves a space you can see at small sizes.- Parameters:
dot- ink length of one dotwidth- the stroke width the gap must clear- Returns:
- the gap to use when a theme states none
seriesStroke
AsseriesStroke(int, float, float, float), at the default dot length and a derived gap.- Parameters:
seriesCount- how many independently plotted series the graph carrieswidth- requested line width in pixelsdashLength- ink length of one dot; zero draws a solid line- Returns:
- a solid stroke for a lone series, otherwise round dots
seriesStroke
AsseriesStroke(int, float, float), at the default dot length.- Parameters:
seriesCount- how many independently plotted series the graph carrieswidth- requested line width in pixels- Returns:
- a solid stroke for a lone series, otherwise round dots