Package com.oorian.echarts.options
Class EChartsAxis
java.lang.Object
com.oorian.echarts.options.EChartsAxis
- All Implemented Interfaces:
com.oorian.json.Jsonable
Represents an axis configuration for cartesian charts.
Axes are fundamental components of charts that use rectangular coordinates. This class supports various axis types and extensive customization options.
EChartsAxis types include:
- "value" - Numerical axis for continuous data
- "category" - Category axis for discrete data
- "time" - Time axis for temporal data
- "log" - Logarithmic axis
Key features:
- Customizable range (min/max)
- Tick and label formatting
- EChartsGrid lines and split areas
- EChartsAxis name and positioning
- Interactive features (pointer, events)
Example usage:
EChartsAxis xAxis = new EChartsAxis();
xAxis.setType("category");
xAxis.setName("Month");
xAxis.addData("Jan", "Feb", "Mar");
xAxis.setBoundaryGap(true);
- Author:
- Oorian
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a data item to this axis.Gets the align ticks option.Gets the axis label configuration.Gets the axis line configuration.Gets the axis pointer configuration.Gets the axis tick configuration.Gets the boundary gap option.getData()Gets the data list for this axis.getMax()Gets the maximum value of the axis.getMin()Gets the minimum value of the axis.getName()Gets the axis name.Gets the axis name location.Gets the axis name text style.Gets the split area configuration.Gets the split line configuration.getType()Gets the axis type.voidinitFromJson(com.oorian.json.JsonValue json) voidsetAlignTicks(Boolean alignTicks) Sets the align ticks option.voidsetAxisLabel(EChartsAxisLabel axisLabel) Sets the axis label configuration.voidsetAxisLine(EChartsAxisLine axisLine) Sets the axis line configuration.voidsetAxisPointer(EChartsAxisPointer axisPointer) Sets the axis pointer configuration.voidsetAxisTick(EChartsAxisTick axisTick) Sets the axis tick configuration.voidsetBoundaryGap(Boolean boundaryGap) Sets the boundary gap option.voidSets the data list for this axis.voidSets the maximum value of the axis.voidSets the minimum value of the axis.voidSets the axis name.voidsetNameLocation(String nameLocation) Sets the axis name location.voidsetNameTextStyle(EChartsTextStyle nameTextStyle) Sets the axis name text style.voidsetSplitArea(EChartsSplitArea splitArea) Sets the split area configuration.voidsetSplitLine(EChartsSplitLine splitLine) Sets the split line configuration.voidSets the axis 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, toJsonString
-
Constructor Details
-
EChartsAxis
public EChartsAxis()Constructs a new EChartsAxis with an empty data list.
-
-
Method Details
-
setType
Sets the axis type.- Parameters:
type- the axis type ("value", "category", "time", "log")
-
setName
Sets the axis name.- Parameters:
name- the axis name
-
setNameLocation
Sets the axis name location.- Parameters:
nameLocation- the name location
-
setNameTextStyle
Sets the axis name text style.- Parameters:
nameTextStyle- the text style for the axis name
-
setData
Sets the data list for this axis.- Parameters:
data- the data list to set
-
setBoundaryGap
Sets the boundary gap option.- Parameters:
boundaryGap- whether to have a boundary gap
-
setMin
Sets the minimum value of the axis.Use "dataMin" to automatically use the minimum value from data.
- Parameters:
min- the minimum value
-
setMax
Sets the maximum value of the axis.Use "dataMax" to automatically use the maximum value from data.
- Parameters:
max- the maximum value
-
setAxisLine
Sets the axis line configuration.- Parameters:
axisLine- the axis line configuration
-
setAxisTick
Sets the axis tick configuration.- Parameters:
axisTick- the axis tick configuration
-
setAxisLabel
Sets the axis label configuration.- Parameters:
axisLabel- the axis label configuration
-
setSplitLine
Sets the split line configuration.- Parameters:
splitLine- the split line configuration
-
setSplitArea
Sets the split area configuration.- Parameters:
splitArea- the split area configuration
-
setAxisPointer
Sets the axis pointer configuration.- Parameters:
axisPointer- the axis pointer configuration
-
setAlignTicks
Sets the align ticks option.- Parameters:
alignTicks- whether to align ticks
-
getType
Gets the axis type.- Returns:
- the axis type ("value", "category", "time", "log")
-
getName
Gets the axis name.- Returns:
- the axis name
-
getNameLocation
Gets the axis name location.- Returns:
- the name location
-
getNameTextStyle
Gets the axis name text style.- Returns:
- the text style for the axis name
-
getData
Gets the data list for this axis.- Returns:
- the data list
-
getBoundaryGap
Gets the boundary gap option.- Returns:
- whether there is a boundary gap
-
getMin
Gets the minimum value of the axis.- Returns:
- the minimum value
-
getMax
Gets the maximum value of the axis.- Returns:
- the maximum value
-
getAxisLine
Gets the axis line configuration.- Returns:
- the axis line configuration
-
getAxisTick
Gets the axis tick configuration.- Returns:
- the axis tick configuration
-
getAxisLabel
Gets the axis label configuration.- Returns:
- the axis label configuration
-
getSplitLine
Gets the split line configuration.- Returns:
- the split line configuration
-
getSplitArea
Gets the split area configuration.- Returns:
- the split area configuration
-
getAxisPointer
Gets the axis pointer configuration.- Returns:
- the axis pointer configuration
-
getAlignTicks
Gets the align ticks option.- Returns:
- whether ticks are aligned
-
addData
Adds a data item to this axis.Typically used for category axes to define the categories.
- Parameters:
item- the data item to add
-
initFromJson
public void initFromJson(com.oorian.json.JsonValue json) - Specified by:
initFromJsonin interfacecom.oorian.json.Jsonable
-
toJsonValue
public com.oorian.json.JsonValue toJsonValue()- Specified by:
toJsonValuein interfacecom.oorian.json.Jsonable
-