Package com.oorian.echarts.options
Class EChartsSeries
java.lang.Object
com.oorian.echarts.options.EChartsSeries
- All Implemented Interfaces:
com.oorian.json.Jsonable
- Direct Known Subclasses:
EChartsBarSeries,EChartsBoxplotSeries,EChartsCandlestickSeries,EChartsFunnelSeries,EChartsGaugeSeries,EChartsGraphSeries,EChartsHeatmapSeries,EChartsLineSeries,EChartsParallelSeries,EChartsPieSeries,EChartsRadarSeries,EChartsSankeySeries,EChartsScatterSeries,EChartsSunburstSeries,EChartsThemeRiverSeries,EChartsTreemapSeries,EChartsTreeSeries
Abstract base class for all chart series types.
A series represents a set of data points to be visualized in a chart. Each series has a type (bar, line, pie, etc.), a name, and data values.
This class provides common functionality for all series types:
- EChartsSeries type and name management
- Data storage and manipulation
- JSON serialization/deserialization
Subclasses must implement:
initSpecificFromJson(JsonObject)- to parse type-specific propertiesaddSpecificToJson(JsonObject)- to add type-specific properties
- Author:
- Oorian
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a data item to this series.protected abstract voidaddSpecificToJson(com.oorian.json.JsonObject obj) Adds series-specific properties to a JSON object.getData()Gets the data list for this series.getName()Gets the series name.getType()Gets the series type (e.g., "bar", "line", "pie").voidinitFromJson(com.oorian.json.JsonValue json) protected abstract voidinitSpecificFromJson(com.oorian.json.JsonObject obj) Initializes series-specific properties from a JSON object.protected voidparseDataArray(com.oorian.json.JsonArray array) Parses a JSON array into the data list.voidSets the data list for this series.voidSets the series name.voidSets the series type.com.oorian.json.JsonValueMethods 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
-
Field Details
-
type
-
name
-
data
-
-
Constructor Details
-
EChartsSeries
public EChartsSeries()Constructs a new EChartsSeries with an empty data list.
-
-
Method Details
-
setType
Sets the series type.- Parameters:
type- the series type to set
-
setName
Sets the series name.- Parameters:
name- the series name to set
-
setData
Sets the data list for this series.- Parameters:
data- the data list to set
-
getType
Gets the series type (e.g., "bar", "line", "pie").- Returns:
- the series type
-
getName
Gets the series name.- Returns:
- the series name
-
getData
Gets the data list for this series.- Returns:
- the data list
-
addData
Adds a data item to this series.- Parameters:
item- the data item to add
-
initFromJson
public void initFromJson(com.oorian.json.JsonValue json) - Specified by:
initFromJsonin interfacecom.oorian.json.Jsonable
-
parseDataArray
protected void parseDataArray(com.oorian.json.JsonArray array) Parses a JSON array into the data list.Handles various data types including numbers, strings, objects, and arrays.
- Parameters:
array- the JSON array to parse
-
toJsonValue
public com.oorian.json.JsonValue toJsonValue()- Specified by:
toJsonValuein interfacecom.oorian.json.Jsonable
-
toJsonString
- Specified by:
toJsonStringin interfacecom.oorian.json.Jsonable
-
initSpecificFromJson
protected abstract void initSpecificFromJson(com.oorian.json.JsonObject obj) Initializes series-specific properties from a JSON object.Subclasses must implement this method to handle their specific properties.
- Parameters:
obj- the JSON object containing series properties
-
addSpecificToJson
protected abstract void addSpecificToJson(com.oorian.json.JsonObject obj) Adds series-specific properties to a JSON object.Subclasses must implement this method to serialize their specific properties.
- Parameters:
obj- the JSON object to add properties to
-