Class Markers

java.lang.Object
org.apache.juneau.console.freemarker.Markers
All Implemented Interfaces:
Decorator

public final class Markers extends Object implements Decorator
The built-in markers decorator: vertical mark lines at x values from a list, a same-origin src, a data: topic, or the current time. The lines ride a carrier series juneau-markers-<n>.
Example:

Markers.from("/rest/releases").at("date").label("name").onClick(Topics.custom("app", "release")); Markers.now("Today");

Since:
10.0.0
  • Method Details

    • from

      public static Markers from(String path)
      Parameters:
      path - A same-origin path returning rows. @return A new decorator.
    • values

      public static Markers values(List<? extends Map<String,?>> rows)
      Parameters:
      rows - Inline rows {at, label?, meta?}. @return A new decorator.
    • source

      public static Markers source(String dataTopic)
      Parameters:
      dataTopic - A data: topic (Topics.data(...)). @return A new decorator.
    • now

      public static Markers now(String label)
      Parameters:
      label - The label of a mark line at the current time. @return A new decorator.
    • at

      public Markers at(String field)
      Parameters:
      field - The row field holding the x value. @return This object.
    • label

      public Markers label(String field)
      Parameters:
      field - The row field holding the line label. @return This object.
    • style

      public Markers style(String v)
      Parameters:
      v - solid, dashed or dotted. @return This object.
    • onClick

      public Markers onClick(String topic)
      Parameters:
      topic - A custom topic the card publishes a click on a line to. @return This object.
    • toJson

      public JsonMap toJson()
      Specified by:
      toJson in interface Decorator
      Returns:
      A new map {"use": name, ...args}; a string topic key is published on click, and ChartDef.decorate(Decorator) adds it to the card's publishes.