Class CartesianScaleTitle
- java.lang.Object
-
- org.pepstock.charba.client.configuration.CartesianScaleTitle
-
public class CartesianScaleTitle extends Object
When creating a chart, you want to tell the viewer what data they are viewing. To do this, you need to label the axis.
The scale title configuration defines options for the scale title.
Note that this only applies to cartesian axes.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScaleTitleAligngetAlign()Returns the alignment of the axis title.AxisgetAxis()Returns the axis instance.IsColorgetColor()Returns the font color.StringgetColorAsString()Returns the font color as string.FontgetFont()Returns the font element.PaddinggetPadding()Returns the padding element.List<String>getText()Returns the title text to display, as a list of strings.booleanisDisplay()If true, display the axis title.voidsetAlign(ScaleTitleAlign align)Sets the alignment of the axis title.voidsetColor(String color)Sets the font color.voidsetColor(IsColor color)Sets the font color.voidsetDisplay(boolean display)If true, display the axis title.voidsetText(String... text)Sets the title text to display.
If specified as an array, text is rendered on multiple lines.
-
-
-
Method Detail
-
getFont
public Font getFont()
Returns the font element.- Returns:
- the font
-
setColor
public void setColor(IsColor color)
Sets the font color.- Parameters:
color- font color.
-
setColor
public void setColor(String color)
Sets the font color.- Parameters:
color- font color.
-
getColorAsString
public String getColorAsString()
Returns the font color as string.- Returns:
- font color as string
-
getColor
public IsColor getColor()
Returns the font color.- Returns:
- font color
-
getPadding
public Padding getPadding()
Returns the padding element.- Returns:
- the padding
-
setDisplay
public void setDisplay(boolean display)
If true, display the axis title.- Parameters:
display- If true, display the axis title.
-
isDisplay
public boolean isDisplay()
If true, display the axis title.- Returns:
- If true, display the axis title.
-
setText
public void setText(String... text)
Sets the title text to display.
If specified as an array, text is rendered on multiple lines.- Parameters:
text- the title text to display.
If specified as an array, text is rendered on multiple lines.
-
getText
public List<String> getText()
Returns the title text to display, as a list of strings.- Returns:
- a list of strings
-
setAlign
public void setAlign(ScaleTitleAlign align)
Sets the alignment of the axis title.- Parameters:
align- the alignment of the axis title
-
getAlign
public ScaleTitleAlign getAlign()
Returns the alignment of the axis title.- Returns:
- the alignment of the axis title
-
getAxis
public final Axis getAxis()
Returns the axis instance.- Returns:
- the axis
-
-