Package com.oorian.echarts.options
Class EChartsLegend
java.lang.Object
com.oorian.echarts.options.EChartsLegend
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a new EChartsLegend instance with an empty data list. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a data item to the legend.Returns the bottom position of the legend.getData()Returns the data items for the legend.getLeft()Returns the left position of the legend.Returns the orientation of the legend.getRight()Returns the right position of the legend.Returns the text style for the legend.getTop()Returns the top position of the legend.getType()Returns the legend type.voidinitFromJson(com.oorian.json.JsonValue json) Initializes this EChartsLegend from a JSON value.voidSets the bottom position of the legend.voidSets the data items for the legend.voidSets the left position of the legend.voidSets the orientation of the legend.voidSets the right position of the legend.voidsetTextStyle(EChartsTextStyle textStyle) Sets the text style for the legend.voidSets the top position of the legend.voidSets the legend type.Converts this EChartsLegend to a JSON string.com.oorian.json.JsonValueConverts this EChartsLegend to a JSON value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.json.Jsonable
initFromJson, initFromJson
-
Constructor Details
-
EChartsLegend
public EChartsLegend()Creates a new EChartsLegend instance with an empty data list.
-
-
Method Details
-
setType
Sets the legend type.- Parameters:
type- The legend type (e.g., "plain", "scroll").
-
setLeft
Sets the left position of the legend.- Parameters:
left- The left position value (e.g., "10%", "center", "left").
-
setTop
Sets the top position of the legend.- Parameters:
top- The top position value (e.g., "10%", "top", "middle").
-
setRight
Sets the right position of the legend.- Parameters:
right- The right position value (e.g., "10%", "right").
-
setBottom
Sets the bottom position of the legend.- Parameters:
bottom- The bottom position value (e.g., "10%", "bottom").
-
setOrient
Sets the orientation of the legend.- Parameters:
orient- The orientation (e.g., "horizontal", "vertical").
-
setData
Sets the data items for the legend.- Parameters:
data- The list of legend item names.
-
setTextStyle
Sets the text style for the legend.- Parameters:
textStyle- The text style configuration.
-
getType
Returns the legend type.- Returns:
- The legend type.
-
getLeft
Returns the left position of the legend.- Returns:
- The left position value.
-
getTop
Returns the top position of the legend.- Returns:
- The top position value.
-
getRight
Returns the right position of the legend.- Returns:
- The right position value.
-
getBottom
Returns the bottom position of the legend.- Returns:
- The bottom position value.
-
getOrient
Returns the orientation of the legend.- Returns:
- The orientation.
-
getData
Returns the data items for the legend.- Returns:
- The list of legend item names.
-
getTextStyle
Returns the text style for the legend.- Returns:
- The text style configuration.
-
addData
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:
initFromJsonin interfacecom.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:
toJsonValuein interfacecom.oorian.json.Jsonable- Returns:
- The JSON representation of this EChartsLegend.
-
toJsonString
Converts this EChartsLegend to a JSON string.- Specified by:
toJsonStringin interfacecom.oorian.json.Jsonable- Returns:
- The JSON string representation of this EChartsLegend.
-