Package com.oorian.chartjs
Class CjChartOptions
java.lang.Object
com.oorian.chartjs.CjChartOptions
- All Implemented Interfaces:
com.oorian.json.Jsonable
Options configuration for Chart.js charts.
Contains all chart options including responsive behavior, interaction, animation, scales, and plugins.
Usage:
CjChartOptions options = new CjChartOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setInteraction(new CjInteractionConfig()
.setMode(InteractionMode.INDEX))
.setScales(new CjScales()
.setYBeginAtZero(true));
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHover()booleanChecks if this configuration has any values set.voidinitFromJson(com.oorian.json.JsonValue json) setAnimation(CjAnimationConfig animation) Sets the animation configuration.setAspectRatio(double ratio) Sets the aspect ratio.setHover(CjInteractionConfig hover) Sets the hover configuration.setIndexAxis(IndexAxis axis) Sets the index axis for horizontal bar charts.setInteraction(CjInteractionConfig interaction) Sets the interaction configuration.setMaintainAspectRatio(boolean maintain) Sets whether to maintain aspect ratio.setPlugins(CjPlugins plugins) Sets the plugins configuration.setResponsive(boolean responsive) Sets whether the chart is responsive.Sets the scales configuration.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
-
CjChartOptions
public CjChartOptions()Creates a new chart options configuration.
-
-
Method Details
-
setResponsive
Sets whether the chart is responsive.- Parameters:
responsive- True for responsive sizing- Returns:
- This instance for method chaining
-
setMaintainAspectRatio
Sets whether to maintain aspect ratio.- Parameters:
maintain- True to maintain aspect ratio- Returns:
- This instance for method chaining
-
setAspectRatio
Sets the aspect ratio.- Parameters:
ratio- The aspect ratio (width/height)- Returns:
- This instance for method chaining
-
setIndexAxis
Sets the index axis for horizontal bar charts.- Parameters:
axis- The index axis (X for vertical, Y for horizontal)- Returns:
- This instance for method chaining
-
setInteraction
Sets the interaction configuration.- Parameters:
interaction- The interaction configuration- Returns:
- This instance for method chaining
-
setHover
Sets the hover configuration.- Parameters:
hover- The hover configuration- Returns:
- This instance for method chaining
-
setAnimation
Sets the animation configuration.- Parameters:
animation- The animation configuration- Returns:
- This instance for method chaining
-
setScales
Sets the scales configuration.- Parameters:
scales- The scales configuration- Returns:
- This instance for method chaining
-
setPlugins
Sets the plugins configuration.- Parameters:
plugins- The plugins configuration- Returns:
- This instance for method chaining
-
getResponsive
-
getMaintainAspectRatio
-
getAspectRatio
-
getIndexAxis
-
getInteraction
-
getHover
-
getAnimation
-
getScales
-
getPlugins
-
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
-