Package com.oorian.chartjs
Class CjAxisConfig
java.lang.Object
com.oorian.chartjs.CjAxisConfig
- All Implemented Interfaces:
com.oorian.json.Jsonable
Configuration for a single axis in Chart.js charts.
Usage:
CjAxisConfig xAxis = new CjAxisConfig()
.setType(ScaleType.LINEAR)
.setMin(0)
.setMax(100)
.setTitle("X Axis")
.setBeginAtZero(true);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMax()getMin()getTitle()getType()booleanChecks if this configuration has any values set.voidinitFromJson(com.oorian.json.JsonValue json) setBeginAtZero(boolean beginAtZero) Sets whether the axis should begin at zero.setDisplay(boolean display) Sets whether the axis is displayed.setGridColor(String color) Sets the grid line color.setGridDisplay(boolean display) Sets whether to display grid lines.setGridLineWidth(int width) Sets the grid line width.Sets the maximum value.Sets the minimum value.setReverse(boolean reverse) Sets whether the axis is reversed.setStacked(boolean stacked) Sets whether values are stacked.setTicksColor(String color) Sets the tick label color.setTicksDisplay(boolean display) Sets whether to display tick marks.setTicksFontSize(int size) Sets the tick label font size.Sets the axis title text.setTitleColor(String color) Sets the title color.setTitleDisplay(boolean display) Sets whether to display the title.setTitleFont(String size, String weight) Sets the title font.Sets the 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
-
CjAxisConfig
public CjAxisConfig()Creates a new axis configuration.
-
-
Method Details
-
setType
Sets the scale type.- Parameters:
type- The scale type- Returns:
- This instance for method chaining
-
setMin
Sets the minimum value.- Parameters:
min- The minimum value- Returns:
- This instance for method chaining
-
setMax
Sets the maximum value.- Parameters:
max- The maximum value- Returns:
- This instance for method chaining
-
setBeginAtZero
Sets whether the axis should begin at zero.- Parameters:
beginAtZero- True to begin at zero- Returns:
- This instance for method chaining
-
setStacked
Sets whether values are stacked.- Parameters:
stacked- True to stack- Returns:
- This instance for method chaining
-
setReverse
Sets whether the axis is reversed.- Parameters:
reverse- True to reverse- Returns:
- This instance for method chaining
-
setDisplay
Sets whether the axis is displayed.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setTitle
Sets the axis title text.- Parameters:
title- The title text- Returns:
- This instance for method chaining
-
setTitleDisplay
Sets whether to display the title.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setTitleColor
Sets the title color.- Parameters:
color- The CSS color value- Returns:
- This instance for method chaining
-
setTitleFont
Sets the title font.- Parameters:
size- The font size (e.g., "14", "16px")weight- The font weight (e.g., "bold", "normal")- Returns:
- This instance for method chaining
-
setGridDisplay
Sets whether to display grid lines.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setGridColor
Sets the grid line color.- Parameters:
color- The CSS color value- Returns:
- This instance for method chaining
-
setGridLineWidth
Sets the grid line width.- Parameters:
width- The line width in pixels- Returns:
- This instance for method chaining
-
setTicksDisplay
Sets whether to display tick marks.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setTicksColor
Sets the tick label color.- Parameters:
color- The CSS color value- Returns:
- This instance for method chaining
-
setTicksFontSize
Sets the tick label font size.- Parameters:
size- The font size in pixels- Returns:
- This instance for method chaining
-
getType
-
getMin
-
getMax
-
getBeginAtZero
-
getStacked
-
getReverse
-
getDisplay
-
getTitle
-
getTitleDisplay
-
getTitleColor
-
getGridDisplay
-
getGridColor
-
getGridLineWidth
-
getTicksDisplay
-
getTicksColor
-
getTicksFontSize
-
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
-
hasValues
public boolean hasValues()Checks if this configuration has any values set.- Returns:
- True if any property is set
-