Package com.oorian.chartjs
Class CjTitleConfig
java.lang.Object
com.oorian.chartjs.CjTitleConfig
- All Implemented Interfaces:
com.oorian.json.Jsonable
Configuration for Chart.js title and subtitle plugins.
Usage:
CjTitleConfig title = new CjTitleConfig()
.setText("Monthly Sales Report")
.setColor("#333")
.setFontSize(18)
.setFontWeight("bold");
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new title configuration.CjTitleConfig(String text) Creates a new title configuration with text. -
Method Summary
Modifier and TypeMethodDescriptiongetAlign()getColor()getText()booleanChecks if this configuration has any values set.voidinitFromJson(com.oorian.json.JsonValue json) Sets the title alignment.Sets the title color.setDisplay(boolean display) Sets whether to display the title.Sets the font configuration.setFontFamily(String family) Sets the font family.setFontSize(int size) Sets the font size.setFontWeight(String weight) Sets the font weight.setPadding(int padding) Sets the padding around the title.setPosition(LegendPosition position) Sets the title position.Sets the title text.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
-
CjTitleConfig
public CjTitleConfig()Creates a new title configuration. -
CjTitleConfig
Creates a new title configuration with text.- Parameters:
text- The title text
-
-
Method Details
-
setDisplay
Sets whether to display the title.- Parameters:
display- True to display- Returns:
- This instance for method chaining
-
setText
Sets the title text.- Parameters:
text- The title text- Returns:
- This instance for method chaining
-
setPosition
Sets the title position.- Parameters:
position- The position- Returns:
- This instance for method chaining
-
setColor
Sets the title color.- Parameters:
color- The CSS color value- Returns:
- This instance for method chaining
-
setAlign
Sets the title alignment.- Parameters:
align- "start", "center", or "end"- Returns:
- This instance for method chaining
-
setPadding
Sets the padding around the title.- Parameters:
padding- The padding in pixels- Returns:
- This instance for method chaining
-
setFontSize
Sets the font size.- Parameters:
size- The font size in pixels- Returns:
- This instance for method chaining
-
setFontWeight
Sets the font weight.- Parameters:
weight- The font weight (e.g., "bold", "normal", "600")- Returns:
- This instance for method chaining
-
setFontFamily
Sets the font family.- Parameters:
family- The font family- Returns:
- This instance for method chaining
-
setFont
Sets the font configuration.- Parameters:
size- The font size in pixelsweight- The font weight- Returns:
- This instance for method chaining
-
getDisplay
-
getText
-
getPosition
-
getColor
-
getAlign
-
getPadding
-
getFontSize
-
getFontWeight
-
getFontFamily
-
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
-