Class EChartsLegend

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

public class EChartsLegend extends Object implements com.oorian.json.Jsonable
Represents the legend configuration for an ECharts chart. The legend displays series names and allows users to toggle series visibility.
Author:
Oorian
  • Constructor Details

    • EChartsLegend

      public EChartsLegend()
      Creates a new EChartsLegend instance with an empty data list.
  • Method Details

    • setType

      public void setType(String type)
      Sets the legend type.
      Parameters:
      type - The legend type (e.g., "plain", "scroll").
    • setLeft

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

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

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

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

      public void setOrient(String orient)
      Sets the orientation of the legend.
      Parameters:
      orient - The orientation (e.g., "horizontal", "vertical").
    • setData

      public void setData(List<String> data)
      Sets the data items for the legend.
      Parameters:
      data - The list of legend item names.
    • setTextStyle

      public void setTextStyle(EChartsTextStyle textStyle)
      Sets the text style for the legend.
      Parameters:
      textStyle - The text style configuration.
    • getType

      public String getType()
      Returns the legend type.
      Returns:
      The legend type.
    • getLeft

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

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

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

      public String getBottom()
      Returns the bottom position of the legend.
      Returns:
      The bottom position value.
    • getOrient

      public String getOrient()
      Returns the orientation of the legend.
      Returns:
      The orientation.
    • getData

      public List<String> getData()
      Returns the data items for the legend.
      Returns:
      The list of legend item names.
    • getTextStyle

      public EChartsTextStyle getTextStyle()
      Returns the text style for the legend.
      Returns:
      The text style configuration.
    • addData

      public void addData(String item)
      Adds a data item to the legend.
      Parameters:
      item - The legend item name to add.
    • initFromJson

      public void initFromJson(com.oorian.json.JsonValue json)
      Initializes this EChartsLegend 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 EChartsLegend to a JSON value.
      Specified by:
      toJsonValue in interface com.oorian.json.Jsonable
      Returns:
      The JSON representation of this EChartsLegend.
    • toJsonString

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