Class EChartsTitle

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

public class EChartsTitle extends Object implements com.oorian.json.Jsonable
Represents the title configuration for an ECharts chart. The title can include main text and subtext with customizable positioning and styling options.
Author:
Oorian
  • Constructor Details

    • EChartsTitle

      public EChartsTitle()
      Creates a new EChartsTitle instance with no initial text.
    • EChartsTitle

      public EChartsTitle(String text)
      Creates a new EChartsTitle instance with the specified main text.
      Parameters:
      text - The main title text.
    • EChartsTitle

      public EChartsTitle(String text, String subtext)
      Creates a new EChartsTitle instance with the specified main text and subtext.
      Parameters:
      text - The main title text.
      subtext - The subtitle text.
  • Method Details

    • setText

      public void setText(String text)
      Sets the main title text.
      Parameters:
      text - The main title text.
    • setSubtext

      public void setSubtext(String subtext)
      Sets the subtitle text.
      Parameters:
      subtext - The subtitle text.
    • setLeft

      public void setLeft(String left)
      Sets the left position of the title.
      Parameters:
      left - The left position value (e.g., "10%", "center", "left").
    • setTop

      public void setTop(String top)
      Sets the top position of the title.
      Parameters:
      top - The top position value (e.g., "10%", "top", "middle").
    • setRight

      public void setRight(String right)
      Sets the right position of the title.
      Parameters:
      right - The right position value (e.g., "10%", "right").
    • setBottom

      public void setBottom(String bottom)
      Sets the bottom position of the title.
      Parameters:
      bottom - The bottom position value (e.g., "10%", "bottom").
    • setTextStyle

      public void setTextStyle(EChartsTextStyle textStyle)
      Sets the text style for the main title.
      Parameters:
      textStyle - The text style configuration.
    • setSubtextStyle

      public void setSubtextStyle(EChartsTextStyle subtextStyle)
      Sets the text style for the subtitle.
      Parameters:
      subtextStyle - The subtitle text style configuration.
    • getText

      public String getText()
      Returns the main title text.
      Returns:
      The main title text.
    • getSubtext

      public String getSubtext()
      Returns the subtitle text.
      Returns:
      The subtitle text.
    • getLeft

      public String getLeft()
      Returns the left position of the title.
      Returns:
      The left position value.
    • getTop

      public String getTop()
      Returns the top position of the title.
      Returns:
      The top position value.
    • getRight

      public String getRight()
      Returns the right position of the title.
      Returns:
      The right position value.
    • getBottom

      public String getBottom()
      Returns the bottom position of the title.
      Returns:
      The bottom position value.
    • getTextStyle

      public EChartsTextStyle getTextStyle()
      Returns the text style for the main title.
      Returns:
      The text style configuration.
    • getSubtextStyle

      public EChartsTextStyle getSubtextStyle()
      Returns the text style for the subtitle.
      Returns:
      The subtitle text style configuration.
    • initFromJson

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

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

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