Class Layer

All Implemented Interfaces:
ViewComposition

public class Layer extends View implements ViewComposition
To superimpose one chart on top of another.
  • Constructor Details

    • Layer

      public Layer(View... views)
      Constructor. Note: Specifications inside layer cannot use row and column channels as layering facet specifications is not allowed. Instead, use the facet operator and place a layer inside a facet.
      Parameters:
      views - Layer or single view specifications to be superimposed.
  • Method Details

    • width

      public Layer width(int width)
      Description copied from class: View
      Sets the width of a plot with a continuous x-field, or the fixed width of a plot a discrete x-field or no x-field.
      Overrides:
      width in class View
    • height

      public Layer height(int height)
      Description copied from class: View
      Sets the height of a plot with a continuous y-field, or the fixed height of a plot a discrete y-field or no y-field.
      Overrides:
      height in class View
    • width

      public Layer width(String width)
      Description copied from class: View
      To enable responsive sizing on width.
      Overrides:
      width in class View
      Parameters:
      width - it should be set to "container".
    • height

      public Layer height(String height)
      Description copied from class: View
      To enable responsive sizing on height.
      Overrides:
      height in class View
      Parameters:
      height - it should be set to "container".
    • widthStep

      public Layer widthStep(int step)
      Description copied from class: View
      For a discrete x-field, sets the width per discrete step.
      Overrides:
      widthStep in class View
    • heightStep

      public Layer heightStep(int step)
      Description copied from class: View
      For a discrete y-field, sets the height per discrete step.
      Overrides:
      heightStep in class View
    • encodeValue

      public Layer encodeValue(String channel, int value)
      Description copied from class: View
      Sets an encoded constant visual value.
      Overrides:
      encodeValue in class View
      Parameters:
      channel - the encoding channel.
      value - the constant visual value.
      Returns:
      this object.
    • encodeValue

      public Layer encodeValue(String channel, double value)
      Description copied from class: View
      Sets an encoded constant visual value.
      Overrides:
      encodeValue in class View
      Parameters:
      channel - the encoding channel.
      value - the constant visual value.
      Returns:
      this object.
    • encodeValue

      public Layer encodeValue(String channel, String value)
      Description copied from class: View
      Sets an encoded constant visual value.
      Overrides:
      encodeValue in class View
      Parameters:
      channel - the encoding channel.
      value - the constant visual value.
      Returns:
      this object.
    • encodeDatum

      public Layer encodeDatum(String channel, int datum)
      Description copied from class: View
      Sets a constant data value encoded via a scale.
      Overrides:
      encodeDatum in class View
      Parameters:
      channel - the encoding channel.
      datum - the constant data value.
      Returns:
      this object.
    • encodeDatum

      public Layer encodeDatum(String channel, double datum)
      Description copied from class: View
      Sets a constant data value encoded via a scale.
      Overrides:
      encodeDatum in class View
      Parameters:
      channel - the encoding channel.
      datum - the constant data value.
      Returns:
      this object.
    • encodeDatum

      public Layer encodeDatum(String channel, String datum)
      Description copied from class: View
      Sets a constant data value encoded via a scale.
      Overrides:
      encodeDatum in class View
      Parameters:
      channel - the encoding channel.
      datum - the constant data value.
      Returns:
      this object.
    • resolveScale

      public Layer resolveScale(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets a scale resolution. For scales, resolution can be specified for every channel.
      Specified by:
      resolveScale in interface ViewComposition
      Parameters:
      channel - positional or non-positional channel.
      resolution - "shared" or "independent".
      Returns:
      this object.
    • resolveAxis

      public Layer resolveAxis(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets an axis resolution.
      Specified by:
      resolveAxis in interface ViewComposition
      Parameters:
      channel - positional channel: "x" or "y".
      resolution - "shared" or "independent".
      Returns:
      this object.
    • resolveLegend

      public Layer resolveLegend(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets a legend resolution.
      Specified by:
      resolveLegend in interface ViewComposition
      Parameters:
      channel - non-positional channel: "color", "opacity", "shape", or "size".
      resolution - "shared" or "independent".
      Returns:
      this object.