Package com.oorian.echarts.options
Class EChartsLabel
java.lang.Object
com.oorian.echarts.options.EChartsLabel
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the distance from the label to the host element.Gets the formatter for the label content.Gets the offset of the label from its default position.Gets the position of the label.Gets the rotation angle of the label.getShow()Gets whether the label is displayed.Gets the text style for the label.voidinitFromJson(com.oorian.json.JsonValue json) Initializes this EChartsLabel from a JSON value.voidsetDistance(Number distance) Sets the distance from the label to the host element.voidsetFormatter(String formatter) Sets the formatter for the label content.voidSets the offset of the label from its default position.voidsetPosition(String position) Sets the position of the label.voidSets the rotation angle of the label.voidSets whether the label is displayed.voidsetTextStyle(EChartsTextStyle textStyle) Sets the text style for the label.Converts this EChartsLabel to a JSON string.com.oorian.json.JsonValueConverts this EChartsLabel 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
-
EChartsLabel
public EChartsLabel()Constructs a new EChartsLabel with default settings.
-
-
Method Details
-
setShow
Sets whether the label is displayed.- Parameters:
show- true to show the label, false to hide it
-
setPosition
Sets the position of the label.- Parameters:
position- the position (e.g., "top", "inside", "outside")
-
setDistance
Sets the distance from the label to the host element.- Parameters:
distance- the distance in pixels
-
setRotate
Sets the rotation angle of the label.- Parameters:
rotate- the rotation angle in degrees
-
setOffset
Sets the offset of the label from its default position.- Parameters:
offset- the offset value
-
setFormatter
Sets the formatter for the label content.- Parameters:
formatter- the formatter string or function
-
setTextStyle
Sets the text style for the label.- Parameters:
textStyle- the text style configuration
-
getShow
Gets whether the label is displayed.- Returns:
- true if shown, false if hidden
-
getPosition
Gets the position of the label.- Returns:
- the position
-
getDistance
Gets the distance from the label to the host element.- Returns:
- the distance in pixels
-
getRotate
Gets the rotation angle of the label.- Returns:
- the rotation angle in degrees
-
getOffset
Gets the offset of the label from its default position.- Returns:
- the offset value
-
getFormatter
Gets the formatter for the label content.- Returns:
- the formatter string or function
-
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:
initFromJsonin interfacecom.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:
toJsonValuein interfacecom.oorian.json.Jsonable- Returns:
- the JSON representation
-
toJsonString
Converts this EChartsLabel to a JSON string.- Specified by:
toJsonStringin interfacecom.oorian.json.Jsonable- Returns:
- the JSON string representation
-