Class CjTitleConfig

java.lang.Object
com.oorian.chartjs.CjTitleConfig
All Implemented Interfaces:
com.oorian.json.Jsonable

public class CjTitleConfig extends Object implements 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 Details

    • CjTitleConfig

      public CjTitleConfig()
      Creates a new title configuration.
    • CjTitleConfig

      public CjTitleConfig(String text)
      Creates a new title configuration with text.
      Parameters:
      text - The title text
  • Method Details

    • setDisplay

      public CjTitleConfig setDisplay(boolean display)
      Sets whether to display the title.
      Parameters:
      display - True to display
      Returns:
      This instance for method chaining
    • setText

      public CjTitleConfig setText(String text)
      Sets the title text.
      Parameters:
      text - The title text
      Returns:
      This instance for method chaining
    • setPosition

      public CjTitleConfig setPosition(LegendPosition position)
      Sets the title position.
      Parameters:
      position - The position
      Returns:
      This instance for method chaining
    • setColor

      public CjTitleConfig setColor(String color)
      Sets the title color.
      Parameters:
      color - The CSS color value
      Returns:
      This instance for method chaining
    • setAlign

      public CjTitleConfig setAlign(String align)
      Sets the title alignment.
      Parameters:
      align - "start", "center", or "end"
      Returns:
      This instance for method chaining
    • setPadding

      public CjTitleConfig setPadding(int padding)
      Sets the padding around the title.
      Parameters:
      padding - The padding in pixels
      Returns:
      This instance for method chaining
    • setFontSize

      public CjTitleConfig setFontSize(int size)
      Sets the font size.
      Parameters:
      size - The font size in pixels
      Returns:
      This instance for method chaining
    • setFontWeight

      public CjTitleConfig setFontWeight(String weight)
      Sets the font weight.
      Parameters:
      weight - The font weight (e.g., "bold", "normal", "600")
      Returns:
      This instance for method chaining
    • setFontFamily

      public CjTitleConfig setFontFamily(String family)
      Sets the font family.
      Parameters:
      family - The font family
      Returns:
      This instance for method chaining
    • setFont

      public CjTitleConfig setFont(int size, String weight)
      Sets the font configuration.
      Parameters:
      size - The font size in pixels
      weight - The font weight
      Returns:
      This instance for method chaining
    • getDisplay

      public Boolean getDisplay()
    • getText

      public String getText()
    • getPosition

      public LegendPosition getPosition()
    • getColor

      public String getColor()
    • getAlign

      public String getAlign()
    • getPadding

      public Integer getPadding()
    • getFontSize

      public Integer getFontSize()
    • getFontWeight

      public String getFontWeight()
    • getFontFamily

      public String getFontFamily()
    • initFromJson

      public void initFromJson(com.oorian.json.JsonValue json)
      Specified by:
      initFromJson in interface com.oorian.json.Jsonable
    • toJsonValue

      public com.oorian.json.JsonValue toJsonValue()
      Specified by:
      toJsonValue in interface com.oorian.json.Jsonable
    • hasValues

      public boolean hasValues()
      Checks if this configuration has any values set.
      Returns:
      True if any property is set