Class Condition

All Implemented Interfaces:
Serializable

public class Condition extends AbstractConfigurationObject
Under which conditions the rule applies.
Since:
6.0.1
See Also:
  • Constructor Details

    • Condition

      public Condition()
  • Method Details

    • getCallback

      public String getCallback()
    • setCallback

      public void setCallback(String _fn_callback)
      Sets the JavaScript function of the callback option, as the source code of the function.

      The browser compiles the function from this string, which a Content Security Policy without unsafe-eval blocks: in the strict CSP mode, sending a chart configuration that has a function throws a ContentSecurityPolicyViolationException.

      Setting a function this way clears a function set with setCallbackFunction(ChartFunction), which works without compiling JavaScript in the browser.

      Parameters:
      _fn_callback - the source code of the JavaScript function
    • getCallbackFunction

      public ChartFunction getCallbackFunction()
      See Also:
    • setCallbackFunction

      public void setCallbackFunction(ChartFunction callback)
      Sets the function of the callback option, declared in a JsDefinition interface. The browser runs the function from the frontend bundle, so it works under a Content Security Policy without unsafe-eval.

      Setting a function this way clears a function set with setCallback(String).

      A chart exported to SVG with SVGGenerator does not have the function. Neither does a chart state saved or restored with ChartAiController.

      Parameters:
      callback - the function, or null to remove it
      Since:
      25.4
    • getMaxHeight

      public Number getMaxHeight()
      See Also:
    • setMaxHeight

      public void setMaxHeight(Number maxHeight)
      The responsive rule applies if the chart height is less than this.
    • getMaxWidth

      public Number getMaxWidth()
      See Also:
    • setMaxWidth

      public void setMaxWidth(Number maxWidth)
      The responsive rule applies if the chart width is less than this.
    • getMinHeight

      public Number getMinHeight()
      See Also:
    • setMinHeight

      public void setMinHeight(Number minHeight)
      The responsive rule applies if the chart height is greater than this.

      Defaults to: 0

    • getMinWidth

      public Number getMinWidth()
      See Also:
    • setMinWidth

      public void setMinWidth(Number minWidth)
      The responsive rule applies if the chart width is greater than this.

      Defaults to: 0