org.rrd4j.graph

## Class Stack

- java.lang.Object
- - org.rrd4j.graph.PlotElement
  - - org.rrd4j.graph.SourcedPlotElement
    - - org.rrd4j.graph.Stack

-     class Stack
      extends SourcedPlotElement

  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 org.rrd4j.graph.SourcedPlotElement

      `parent, srcName, values`

    - ### Fields inherited from class org.rrd4j.graph.PlotElement

      `color`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Stack(SourcedPlotElement parent, String srcName, Paint color)` Creates a stacked plot element with the specified parent, source name, and color.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `assignValues(DataProcessor dproc)` Assigns values by stacking this element's data on top of parent values.
    `(package private) Paint` | `getParentColor()` Gets the color of the parent element.
    `(package private) float` | `getParentLineWidth()` Gets the line width of the parent element.

    - ### Methods inherited from class org.rrd4j.graph.SourcedPlotElement

      `getMaxValue, getMinValue, getValues, stackValues`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 of
        `srcName` - the name of the data source
        `color` - the color for this stacked element

  - ### Method Detail

    - #### assignValues

          void assignValues(DataProcessor dproc)

      Assigns values by stacking this element's data on top of parent values. Handles NaN values appropriately to maintain data integrity.
      Overrides:
        `assignValues` in class `SourcedPlotElement`
      Parameters:
        `dproc` - the data processor containing source values

    - #### getParentColor

          Paint getParentColor()

      Gets the color of the parent element.
      Overrides:
        `getParentColor` in class `SourcedPlotElement`
      Returns:
        parent element's color

    - #### 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