Class EChartsLabel

java.lang.Object
com.oorian.echarts.options.EChartsLabel
All Implemented Interfaces:
com.oorian.json.Jsonable

public class EChartsLabel extends Object implements com.oorian.json.Jsonable
Represents the label configuration for ECharts elements. Controls the display, position, formatting, and styling of labels on chart elements.
Author:
Oorian
  • Constructor Details

    • EChartsLabel

      public EChartsLabel()
      Constructs a new EChartsLabel with default settings.
  • Method Details

    • setShow

      public void setShow(Boolean show)
      Sets whether the label is displayed.
      Parameters:
      show - true to show the label, false to hide it
    • setPosition

      public void setPosition(String position)
      Sets the position of the label.
      Parameters:
      position - the position (e.g., "top", "inside", "outside")
    • setDistance

      public void setDistance(Number distance)
      Sets the distance from the label to the host element.
      Parameters:
      distance - the distance in pixels
    • setRotate

      public void setRotate(Number rotate)
      Sets the rotation angle of the label.
      Parameters:
      rotate - the rotation angle in degrees
    • setOffset

      public void setOffset(Number offset)
      Sets the offset of the label from its default position.
      Parameters:
      offset - the offset value
    • setFormatter

      public void setFormatter(String formatter)
      Sets the formatter for the label content.
      Parameters:
      formatter - the formatter string or function
    • setTextStyle

      public void setTextStyle(EChartsTextStyle textStyle)
      Sets the text style for the label.
      Parameters:
      textStyle - the text style configuration
    • getShow

      public Boolean getShow()
      Gets whether the label is displayed.
      Returns:
      true if shown, false if hidden
    • getPosition

      public String getPosition()
      Gets the position of the label.
      Returns:
      the position
    • getDistance

      public Number getDistance()
      Gets the distance from the label to the host element.
      Returns:
      the distance in pixels
    • getRotate

      public Number getRotate()
      Gets the rotation angle of the label.
      Returns:
      the rotation angle in degrees
    • getOffset

      public Number getOffset()
      Gets the offset of the label from its default position.
      Returns:
      the offset value
    • getFormatter

      public String getFormatter()
      Gets the formatter for the label content.
      Returns:
      the formatter string or function
    • getTextStyle

      public EChartsTextStyle getTextStyle()
      Gets the text style for the label.
      Returns:
      the text style configuration
    • initFromJson

      public void initFromJson(com.oorian.json.JsonValue json)
      Initializes this EChartsLabel from a JSON value.
      Specified by:
      initFromJson in interface com.oorian.json.Jsonable
      Parameters:
      json - the JSON value to parse
    • toJsonValue

      public com.oorian.json.JsonValue toJsonValue()
      Converts this EChartsLabel to a JSON value.
      Specified by:
      toJsonValue in interface com.oorian.json.Jsonable
      Returns:
      the JSON representation
    • toJsonString

      public String toJsonString()
      Converts this EChartsLabel to a JSON string.
      Specified by:
      toJsonString in interface com.oorian.json.Jsonable
      Returns:
      the JSON string representation