All Known Implementing Classes:
Axis, CommentText, LegendComposer, LegendText, PrintText, RrdGraph, RrdGraphDef, TimeAxis, ValueAxis, ValueAxisLogarithmic, ValueAxisMrtg

public interface RrdGraphConstants
Class to represent various constants used for graphing. No methods are specified.

The fonts settings can be changed use some on the following properties, sorted by increased priority.

  1. org.rrd4j.fonts.properties
  2. org.rrd4j.fonts.properties.url
  3. org.rrd4j.font.plain
  4. org.rrd4j.font.bold
  5. org.rrd4j.font.plain.url
  6. org.rrd4j.font.bold.url
If either 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.

  • Field Details

  • Method Details

    • seriesStroke

      static Stroke seriesStroke(int seriesCount, float width, float dashLength, float dashGap)
      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 carries
      width - requested line width in pixels
      dashLength - ink length of one dot; zero draws a solid line, and negative values fall back to SERIES_DOT
      dashGap - space after the dot, as a CSS --graph_plotDash pair 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

      static Stroke gridStroke(float width, float dashLength, float dashGap)
      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 pixels
      dashLength - ink length of one dot; zero draws a solid line
      dashGap - 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 + width of ink. Dots stay separate while the period exceeds that, which makes width the 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 dot
      width - the stroke width the gap must clear
      Returns:
      the gap to use when a theme states none
    • seriesStroke

      static Stroke seriesStroke(int seriesCount, float width, float dashLength)
      As seriesStroke(int, float, float, float), at the default dot length and a derived gap.
      Parameters:
      seriesCount - how many independently plotted series the graph carries
      width - requested line width in pixels
      dashLength - ink length of one dot; zero draws a solid line
      Returns:
      a solid stroke for a lone series, otherwise round dots
    • seriesStroke

      static Stroke seriesStroke(int seriesCount, float width)
      As seriesStroke(int, float, float), at the default dot length.
      Parameters:
      seriesCount - how many independently plotted series the graph carries
      width - requested line width in pixels
      Returns:
      a solid stroke for a lone series, otherwise round dots