java.lang.Object
org.rrd4j.graph.Mapper
Maps data coordinates to pixel coordinates for RRD graph rendering. Handles conversion between time/value coordinates and screen pixel positions.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RrdGraphDefThe graph being drawn.private final ImageParametersWhere the drawing happens.private final doublePixels per data unit, in each direction.private final doublePixels per data unit, in each direction.Constructor Summary
ConstructorsConstructorDescriptionMapper(RrdGraphDef gdef, ImageParameters im) Creates a new mapper for the specified graph definition and image parameters.Method Summary
All Methods
Field Details
gdef
The graph being drawn.im
Where the drawing happens.pixieX
private final double pixieXPixels per data unit, in each direction.pixieY
private final double pixieYPixels 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 informationim- 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