Class CjInteractionConfig

java.lang.Object
com.oorian.chartjs.CjInteractionConfig
All Implemented Interfaces:
com.oorian.json.Jsonable

public class CjInteractionConfig extends Object implements com.oorian.json.Jsonable
Configuration for Chart.js interaction settings.

Usage:


 CjInteractionConfig interaction = new CjInteractionConfig()
     .setMode(InteractionMode.INDEX)
     .setIntersect(false);
 
  • Constructor Details

    • CjInteractionConfig

      public CjInteractionConfig()
      Creates a new interaction configuration.
  • Method Details

    • setMode

      public CjInteractionConfig setMode(InteractionMode mode)
      Sets the interaction mode.
      Parameters:
      mode - The interaction mode
      Returns:
      This instance for method chaining
    • setIntersect

      public CjInteractionConfig setIntersect(boolean intersect)
      Sets whether to only trigger when directly over an element.
      Parameters:
      intersect - True for intersect mode
      Returns:
      This instance for method chaining
    • setAxis

      public CjInteractionConfig setAxis(String axis)
      Sets the axis to use for interaction.
      Parameters:
      axis - "x", "y", "xy", or "r"
      Returns:
      This instance for method chaining
    • getMode

      public InteractionMode getMode()
    • getIntersect

      public Boolean getIntersect()
    • getAxis

      public String getAxis()
    • initFromJson

      public void initFromJson(com.oorian.json.JsonValue json)
      Specified by:
      initFromJson in interface com.oorian.json.Jsonable
    • toJsonValue

      public com.oorian.json.JsonValue toJsonValue()
      Specified by:
      toJsonValue in interface com.oorian.json.Jsonable
    • hasValues

      public boolean hasValues()
      Checks if this configuration has any values set.
      Returns:
      True if any property is set