java.lang.Object
org.rrd4j.graph.PlotElement
org.rrd4j.graph.SourcedPlotElement
org.rrd4j.graph.Stack
Represents a stacked plot element in RRD graphs. Extends SourcedPlotElement to stack values on top of a parent element for cumulative graphing. Enables creation of stacked area and line charts showing cumulative totals.
Field Summary
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
ConstructorsConstructorDescriptionStack(SourcedPlotElement parent, String srcName, Paint color) Creates a stacked plot element with the specified parent, source name, and color.Method Summary
All MethodsModifier and TypeMethodDescription(package private) voidassignValues(DataProcessor dproc) Assigns values by stacking this element's data on top of parent values.(package private) PaintGets the color of the parent element.(package private) floatGets the line width of the parent element.Methods inherited from class SourcedPlotElement
getMaxValue, getMinValue, getValues, stackValuesModifier and TypeMethodDescription(package private) doubleGet the maximum value.(package private) doubleGet the minimum value.(package private) double[]Get the values.(package private) double[]stackValues(DataProcessor dproc) Stack values on top of parent values.
Constructor Details
Stack
Stack(SourcedPlotElement parent, String srcName, Paint color) Creates a stacked plot element with the specified parent, source name, and color.- Parameters:
parent- the parent plot element to stack on top ofsrcName- the name of the data sourcecolor- the color for this stacked element
Method Details
assignValues
Assigns values by stacking this element's data on top of parent values. Handles NaN values appropriately to maintain data integrity.- Overrides:
assignValuesin classSourcedPlotElement- Parameters:
dproc- the data processor containing source values
getParentLineWidth
float getParentLineWidth()Gets the line width of the parent element. Returns -1 for area elements (indicating no line width).- Returns:
- parent line width, or -1 for area elements
getParentColor
Paint getParentColor()Gets the color of the parent element.- Overrides:
getParentColorin classSourcedPlotElement- Returns:
- parent element's color