Package com.oorian.echarts.options
Class EChartsPieSeries
java.lang.Object
com.oorian.echarts.options.EChartsSeries
com.oorian.echarts.options.EChartsPieSeries
- All Implemented Interfaces:
com.oorian.json.Jsonable
Represents a pie series configuration for ECharts pie charts.
Extends EChartsSeries to provide pie-specific options such as radius, center position, rose type, and label styling.
- Author:
- Oorian
-
Field Summary
Fields inherited from class com.oorian.echarts.options.EChartsSeries
data, name, type -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new EChartsPieSeries with type set to "pie". -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a data point for the pie chart with name and value.protected voidaddSpecificToJson(com.oorian.json.JsonObject obj) Adds series-specific properties to a JSON object.Gets the avoid label overlap setting.com.oorian.json.JsonArrayGets the center position.Gets the clockwise setting.Gets the emphasis configuration.Gets the item style configuration.getLabel()Gets the label configuration.Gets the label line configuration.Gets the minimum angle.Gets the minimum show label angle.Gets the radius value.Gets the rose type setting.Gets the start angle.Gets the still show zero sum setting.protected voidinitSpecificFromJson(com.oorian.json.JsonObject obj) Initializes series-specific properties from a JSON object.voidsetAvoidLabelOverlap(Boolean avoidLabelOverlap) Sets whether to prevent label overlap.voidSets the center position of the pie chart.voidsetClockwise(Boolean clockwise) Sets whether the pie chart is drawn clockwise.voidsetEmphasis(EChartsEmphasis emphasis) Sets the emphasis configuration for highlighted slices.voidsetItemStyle(EChartsItemStyle itemStyle) Sets the item style configuration for pie slices.voidsetLabel(EChartsLabel label) Sets the label configuration for pie labels.voidsetLabelLine(EChartsLabelLine labelLine) Sets the label line configuration for connecting labels to slices.voidsetMinAngle(Number minAngle) Sets the minimum angle for a pie slice.voidsetMinShowLabelAngle(Number minShowLabelAngle) Sets the minimum angle for showing labels on a pie slice.voidsetRadius(float radius) Sets the radius of the pie chart as a single numeric value.voidSets the radius of the pie chart as inner and outer radius for a donut chart.voidSets the radius of the pie chart as a string (can be percentage like "70%").voidSets the radius of the pie chart as inner and outer radius for a donut chart using percentage strings.voidsetRoseType(Boolean roseType) Sets whether to display as a rose/nightingale chart.voidsetStartAngle(Number startAngle) Sets the starting angle of the pie chart.voidsetStillShowZeroSum(Boolean stillShowZeroSum) Sets whether to show the chart when sum of values is zero.Methods inherited from class com.oorian.echarts.options.EChartsSeries
addData, getData, getName, getType, initFromJson, parseDataArray, setData, setName, setType, toJsonString, toJsonValueMethods 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
-
EChartsPieSeries
public EChartsPieSeries()Constructs a new EChartsPieSeries with type set to "pie".
-
-
Method Details
-
addData
Adds a data point for the pie chart with name and value.- Parameters:
name- the name/label for this data pointvalue- the numeric value
-
setRadius
public void setRadius(float radius) Sets the radius of the pie chart as a single numeric value.- Parameters:
radius- the radius value in pixels
-
setRadius
Sets the radius of the pie chart as a string (can be percentage like "70%").- Parameters:
radius- the radius value as string
-
setRadius
Sets the radius of the pie chart as inner and outer radius for a donut chart.- Parameters:
innerRadius- the inner radius value in pixelsouterRadius- the outer radius value in pixels
-
setRadius
Sets the radius of the pie chart as inner and outer radius for a donut chart using percentage strings.- Parameters:
innerRadius- the inner radius value (e.g., "40%")outerRadius- the outer radius value (e.g., "70%")
-
setCenter
Sets the center position of the pie chart.- Parameters:
x- the x coordinate (can be percentage or pixel value)y- the y coordinate (can be percentage or pixel value)
-
setRoseType
Sets whether to display as a rose/nightingale chart.- Parameters:
roseType- true to enable rose type
-
setStartAngle
Sets the starting angle of the pie chart.- Parameters:
startAngle- the start angle in degrees
-
setMinAngle
Sets the minimum angle for a pie slice.- Parameters:
minAngle- the minimum angle in degrees
-
setMinShowLabelAngle
Sets the minimum angle for showing labels on a pie slice.- Parameters:
minShowLabelAngle- the minimum angle in degrees
-
setClockwise
Sets whether the pie chart is drawn clockwise.- Parameters:
clockwise- true for clockwise direction
-
setAvoidLabelOverlap
Sets whether to prevent label overlap.- Parameters:
avoidLabelOverlap- true to avoid label overlap
-
setStillShowZeroSum
Sets whether to show the chart when sum of values is zero.- Parameters:
stillShowZeroSum- true to still show the chart
-
setItemStyle
Sets the item style configuration for pie slices.- Parameters:
itemStyle- the item style configuration
-
setEmphasis
Sets the emphasis configuration for highlighted slices.- Parameters:
emphasis- the emphasis configuration
-
setLabel
Sets the label configuration for pie labels.- Parameters:
label- the label configuration
-
setLabelLine
Sets the label line configuration for connecting labels to slices.- Parameters:
labelLine- the label line configuration
-
getRadius
Gets the radius value.- Returns:
- the radius value
-
getCenter
public com.oorian.json.JsonArray getCenter()Gets the center position.- Returns:
- the center position array
-
getRoseType
Gets the rose type setting.- Returns:
- true if rose type is enabled
-
getStartAngle
Gets the start angle.- Returns:
- the start angle in degrees
-
getMinAngle
Gets the minimum angle.- Returns:
- the minimum angle in degrees
-
getMinShowLabelAngle
Gets the minimum show label angle.- Returns:
- the minimum show label angle in degrees
-
getClockwise
Gets the clockwise setting.- Returns:
- true if clockwise direction is enabled
-
getAvoidLabelOverlap
Gets the avoid label overlap setting.- Returns:
- true if label overlap avoidance is enabled
-
getStillShowZeroSum
Gets the still show zero sum setting.- Returns:
- true if chart is shown when sum is zero
-
getItemStyle
Gets the item style configuration.- Returns:
- the item style configuration
-
getEmphasis
Gets the emphasis configuration.- Returns:
- the emphasis configuration
-
getLabel
Gets the label configuration.- Returns:
- the label configuration
-
getLabelLine
Gets the label line configuration.- Returns:
- the label line configuration
-
initSpecificFromJson
protected void initSpecificFromJson(com.oorian.json.JsonObject obj) Description copied from class:EChartsSeriesInitializes series-specific properties from a JSON object.Subclasses must implement this method to handle their specific properties.
- Specified by:
initSpecificFromJsonin classEChartsSeries- Parameters:
obj- the JSON object containing series properties
-
addSpecificToJson
protected void addSpecificToJson(com.oorian.json.JsonObject obj) Description copied from class:EChartsSeriesAdds series-specific properties to a JSON object.Subclasses must implement this method to serialize their specific properties.
- Specified by:
addSpecificToJsonin classEChartsSeries- Parameters:
obj- the JSON object to add properties to
-