java.lang.Object
org.rrd4j.graph.PlotElement
org.rrd4j.graph.SourcedPlotElement
org.rrd4j.graph.Line
org.rrd4j.graph.ConstantLine
Represents a line plot element with a constant value in RRD graphs. Extends Line to provide horizontal lines with fixed values across all data points. Useful for showing reference lines, thresholds, or target values.
Field Summary
FieldsFields inherited from class Line
stroke, valueShadeModifier and TypeFieldDescription(package private) final BasicStrokeStroke definition for line rendering(package private) final Color[]Bottom-to-top colour stops shading this line by its value, or null for a flat line.Fields inherited from class SourcedPlotElement
parent, srcName, valuesModifier and TypeFieldDescription(package private) final SourcedPlotElementThe parent element, or null.(package private) final StringThe source name.(package private) double[]The values.Fields inherited from class PlotElement
colorConstructor Summary
ConstructorsConstructorDescriptionConstantLine(double value, Paint color, BasicStroke stroke, SourcedPlotElement parent) Creates a constant line with the specified value, color, stroke, and parent.Method Summary
All MethodsModifier and TypeMethodDescription(package private) voidassignValues(DataProcessor dproc) Assigns constant values to all data points, optionally stacking with parent values.Methods inherited from class SourcedPlotElement
getMaxValue, getMinValue, getParentColor, getValues, stackValuesModifier and TypeMethodDescription(package private) doubleGet the maximum value.(package private) doubleGet the minimum value.(package private) PaintGet the parent's color.(package private) double[]Get the values.(package private) double[]stackValues(DataProcessor dproc) Stack values on top of parent values.
Field Details
value
private final double valueThe constant value for this line
Constructor Details
ConstantLine
ConstantLine(double value, Paint color, BasicStroke stroke, SourcedPlotElement parent) Creates a constant line with the specified value, color, stroke, and parent.- Parameters:
value- the constant value for all data pointscolor- the line colorstroke- the line stroke styleparent- the parent plot element for stacking
Method Details
assignValues
Assigns constant values to all data points, optionally stacking with parent values.- Overrides:
assignValuesin classSourcedPlotElement- Parameters:
dproc- the data processor for value assignment