Package com.oorian.apexcharts
Class ApexSeries
java.lang.Object
com.oorian.apexcharts.ApexSeries
Represents a data series for ApexCharts.
Supports various data formats including simple values, XY points, OHLC candlestick data,
boxplot statistics, and range data.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new series with no name.ApexSeries(String name) Creates a new series with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionAdds a boxplot data point with the five-number summary.addBubblePoint(Object x, Number y, Number z) Adds a bubble data point (x, y, z).Adds a candlestick (OHLC) data point.Adds a single data value.addDataPoint(Object x, Number y) Adds an x-y data point.addRangePoint(Object x, Number start, Number end) Adds a range data point with start and end values.addTimelinePoint(String x, long startTimestamp, long endTimestamp) Adds a range data point with timestamps for timeline/Gantt charts.Sets the color for this series.Sets the data values for this series.Sets the data values for this series from a list.Sets the series name.Sets the series type (for mixed charts).com.oorian.json.JsonObjectConverts this series to a JsonObject.
-
Constructor Details
-
ApexSeries
public ApexSeries()Creates a new series with no name. -
ApexSeries
Creates a new series with the specified name.- Parameters:
name- The series name.
-
-
Method Details
-
setName
Sets the series name.- Parameters:
name- The series name.- Returns:
- This series for method chaining.
-
setType
Sets the series type (for mixed charts).- Parameters:
type- The chart type for this series.- Returns:
- This series for method chaining.
-
setData
Sets the data values for this series.- Parameters:
values- The data values.- Returns:
- This series for method chaining.
-
setData
Sets the data values for this series from a list.- Parameters:
values- The data values.- Returns:
- This series for method chaining.
-
addData
Adds a single data value.- Parameters:
value- The data value.- Returns:
- This series for method chaining.
-
addDataPoint
Adds an x-y data point.- Parameters:
x- The x value.y- The y value.- Returns:
- This series for method chaining.
-
addBubblePoint
Adds a bubble data point (x, y, z).- Parameters:
x- The x value.y- The y value.z- The z value (bubble size).- Returns:
- This series for method chaining.
-
setColor
Sets the color for this series.- Parameters:
color- The color value.- Returns:
- This series for method chaining.
-
addCandlestickPoint
Adds a candlestick (OHLC) data point.- Parameters:
x- The x value (typically a date/timestamp or category).open- The opening value.high- The highest value.low- The lowest value.close- The closing value.- Returns:
- This series for method chaining.
-
addBoxPlotPoint
public ApexSeries addBoxPlotPoint(Object x, Number min, Number q1, Number median, Number q3, Number max) Adds a boxplot data point with the five-number summary.- Parameters:
x- The x value (category name).min- The minimum value.q1- The first quartile (25th percentile).median- The median (50th percentile).q3- The third quartile (75th percentile).max- The maximum value.- Returns:
- This series for method chaining.
-
addRangePoint
Adds a range data point with start and end values. Used for rangeBar and rangeArea charts.- Parameters:
x- The x value (category name).start- The starting value.end- The ending value.- Returns:
- This series for method chaining.
-
addTimelinePoint
Adds a range data point with timestamps for timeline/Gantt charts.- Parameters:
x- The x value (task name).startTimestamp- The start timestamp in milliseconds.endTimestamp- The end timestamp in milliseconds.- Returns:
- This series for method chaining.
-
toJsonObject
public com.oorian.json.JsonObject toJsonObject()Converts this series to a JsonObject.- Returns:
- The JsonObject representation.
-