Package com.oorian.chartjs
Class CjScales
java.lang.Object
com.oorian.chartjs.CjScales
- All Implemented Interfaces:
com.oorian.json.Jsonable
Scale configuration for Chart.js axes.
Provides configuration for X, Y, and R (radial) axes using typed CjAxisConfig objects.
Usage with axis objects:
CjScales scales = new CjScales()
.setXAxis(new CjAxisConfig()
.setType(ScaleType.CATEGORY)
.setTitle("Month"))
.setYAxis(new CjAxisConfig()
.setBeginAtZero(true)
.setMax(100)
.setTitle("Sales"));
Usage with convenience methods:
CjScales scales = new CjScales()
.setXTitle("Month")
.setYTitle("Sales")
.setYBeginAtZero(true)
.setYMax(100);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRAxis()Gets the R-axis configuration.getXAxis()Gets the X-axis configuration.getYAxis()Gets the Y-axis configuration.voidinitFromJson(com.oorian.json.JsonValue json) setRAxis(CjAxisConfig config) Sets the R-axis (radial) configuration.setRBeginAtZero(boolean beginAtZero) Sets whether R-axis should begin at zero.Sets the R-axis (radial) maximum value.Sets the R-axis (radial) minimum value.setXAxis(CjAxisConfig config) Sets the X-axis configuration.setXBeginAtZero(boolean beginAtZero) Sets whether X-axis should begin at zero.setXGridDisplay(boolean display) Sets whether to display the X-axis grid.Sets the X-axis maximum value.Sets the X-axis minimum value.setXReverse(boolean reverse) Sets whether to reverse the X-axis.setXStacked(boolean stacked) Sets whether to stack values on X-axis.setXTicksDisplay(boolean display) Sets whether to display X-axis ticks.Sets the X-axis title.setXTitleDisplay(boolean display) Sets whether to display the X-axis title.Sets the X-axis scale type.setYAxis(CjAxisConfig config) Sets the Y-axis configuration.setYBeginAtZero(boolean beginAtZero) Sets whether Y-axis should begin at zero.setYGridDisplay(boolean display) Sets whether to display the Y-axis grid.Sets the Y-axis maximum value.Sets the Y-axis minimum value.setYReverse(boolean reverse) Sets whether to reverse the Y-axis.setYStacked(boolean stacked) Sets whether to stack values on Y-axis.setYTicksDisplay(boolean display) Sets whether to display Y-axis ticks.Sets the Y-axis title.setYTitleDisplay(boolean display) Sets whether to display the Y-axis title.Sets the Y-axis scale 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
-
CjScales
public CjScales()Creates a new scales configuration.
-
-
Method Details
-
setXAxis
Sets the X-axis configuration.- Parameters:
config- The axis configuration- Returns:
- This instance for method chaining
-
setYAxis
Sets the Y-axis configuration.- Parameters:
config- The axis configuration- Returns:
- This instance for method chaining
-
setRAxis
Sets the R-axis (radial) configuration.- Parameters:
config- The axis configuration- Returns:
- This instance for method chaining
-
setXType
Sets the X-axis scale type.- Parameters:
type- The scale type- Returns:
- This instance for method chaining
-
setXMin
Sets the X-axis minimum value.- Parameters:
min- The minimum value- Returns:
- This instance for method chaining
-
setXMax
Sets the X-axis maximum value.- Parameters:
max- The maximum value- Returns:
- This instance for method chaining
-
setXTitle
Sets the X-axis title.- Parameters:
title- The axis title- Returns:
- This instance for method chaining
-
setXTitleDisplay
Sets whether to display the X-axis title.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setXGridDisplay
Sets whether to display the X-axis grid.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setXTicksDisplay
Sets whether to display X-axis ticks.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setXStacked
Sets whether to stack values on X-axis.- Parameters:
stacked- True to stack- Returns:
- This instance for method chaining
-
setXReverse
Sets whether to reverse the X-axis.- Parameters:
reverse- True to reverse- Returns:
- This instance for method chaining
-
setXBeginAtZero
Sets whether X-axis should begin at zero.- Parameters:
beginAtZero- True to begin at zero- Returns:
- This instance for method chaining
-
setYType
Sets the Y-axis scale type.- Parameters:
type- The scale type- Returns:
- This instance for method chaining
-
setYMin
Sets the Y-axis minimum value.- Parameters:
min- The minimum value- Returns:
- This instance for method chaining
-
setYMax
Sets the Y-axis maximum value.- Parameters:
max- The maximum value- Returns:
- This instance for method chaining
-
setYTitle
Sets the Y-axis title.- Parameters:
title- The axis title- Returns:
- This instance for method chaining
-
setYTitleDisplay
Sets whether to display the Y-axis title.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setYGridDisplay
Sets whether to display the Y-axis grid.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setYTicksDisplay
Sets whether to display Y-axis ticks.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setYStacked
Sets whether to stack values on Y-axis.- Parameters:
stacked- True to stack- Returns:
- This instance for method chaining
-
setYReverse
Sets whether to reverse the Y-axis.- Parameters:
reverse- True to reverse- Returns:
- This instance for method chaining
-
setYBeginAtZero
Sets whether Y-axis should begin at zero.- Parameters:
beginAtZero- True to begin at zero- Returns:
- This instance for method chaining
-
setRMin
Sets the R-axis (radial) minimum value.- Parameters:
min- The minimum value- Returns:
- This instance for method chaining
-
setRMax
Sets the R-axis (radial) maximum value.- Parameters:
max- The maximum value- Returns:
- This instance for method chaining
-
setRBeginAtZero
Sets whether R-axis should begin at zero.- Parameters:
beginAtZero- True to begin at zero- Returns:
- This instance for method chaining
-
getXAxis
Gets the X-axis configuration.- Returns:
- The X-axis config, or null if not set
-
getYAxis
Gets the Y-axis configuration.- Returns:
- The Y-axis config, or null if not set
-
getRAxis
Gets the R-axis configuration.- Returns:
- The R-axis config, or null if not set
-
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
-