java.lang.Object
org.rrd4j.graph.Mapper

class Mapperextends Object
Maps data coordinates to pixel coordinates for RRD graph rendering. Handles conversion between time/value coordinates and screen pixel positions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final RrdGraphDef
    The graph being drawn.
    private final ImageParameters
    Where the drawing happens.
    private final double
    Pixels per data unit, in each direction.
    private final double
    Pixels per data unit, in each direction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new mapper for the specified graph definition and image parameters.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) int
    xtr(double mytime)
    Converts time coordinate to pixel x-coordinate.
    (package private) int
    ytr(double value)
    Converts value coordinate to pixel y-coordinate.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • gdef

      private final RrdGraphDef gdef
      The graph being drawn.
    • im

      private final ImageParameters im
      Where the drawing happens.
    • pixieX

      private final double pixieX
      Pixels per data unit, in each direction.
    • pixieY

      private final double pixieY
      Pixels per data unit, in each direction.
  • Constructor Details

    • Mapper

      Mapper(RrdGraphDef gdef, ImageParameters im)
      Creates a new mapper for the specified graph definition and image parameters.
      Parameters:
      gdef - the graph definition containing scaling information
      im - the image parameters with dimensions and ranges
  • Method Details

    • xtr

      int xtr(double mytime)
      Converts time coordinate to pixel x-coordinate.
      Parameters:
      mytime - timestamp in seconds
      Returns:
      x pixel position
    • ytr

      int ytr(double value)
      Converts value coordinate to pixel y-coordinate. Handles both linear and logarithmic scaling with rigid bounds.
      Parameters:
      value - data value to convert
      Returns:
      y pixel position