Class ChartBackgroundColor
- java.lang.Object
-
- org.pepstock.charba.client.impl.plugins.ChartBackgroundColor
-
- All Implemented Interfaces:
SmartPluginContainer
public final class ChartBackgroundColor extends Object
A plugin implementation to set the background color, gradient or pattern of chart.
If added to defaults, without any configuration, the chart will have aDEFAULT_BACKGROUND_COLOR
background color.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_BACKGROUND_COLOR
Default background color,HtmlColor.WHITE
.static ChartBackgroundColorOptionsFactory
FACTORY
The factory to create optionsstatic String
ID
Plugin ID "charbabackgroundcolor".
-
Constructor Summary
Constructors Constructor Description ChartBackgroundColor()
Default constructor withDEFAULT_BACKGROUND_COLOR
background color.ChartBackgroundColor(String color)
Builds the object with the default background color for all charts.ChartBackgroundColor(Gradient gradient)
Builds the object with the default gradient for all charts.ChartBackgroundColor(IsColor color)
Builds the object with the default background color for all charts.ChartBackgroundColor(Pattern pattern)
Builds the object with the default pattern for all charts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getColor()
Returns the color if it has been set, otherwisenull
.String
getColorAsString()
Returns the color as string if it has been set, otherwisenull
.Gradient
getGradient()
Returns the gradient if it has been set, otherwisenull
.Pattern
getPattern()
Returns the pattern if it has been set, otherwisenull
.void
loadPlugin(PluginsEnvelop<SmartPlugin> envelop)
Loads the plugin to the envelop in order to pass it without exposing the methods.
-
-
-
Field Detail
-
ID
public static final String ID
Plugin ID "charbabackgroundcolor".- See Also:
- Constant Field Values
-
FACTORY
public static final ChartBackgroundColorOptionsFactory FACTORY
The factory to create options
-
DEFAULT_BACKGROUND_COLOR
public static final String DEFAULT_BACKGROUND_COLOR
Default background color,HtmlColor.WHITE
.
-
-
Constructor Detail
-
ChartBackgroundColor
public ChartBackgroundColor()
Default constructor withDEFAULT_BACKGROUND_COLOR
background color.
-
ChartBackgroundColor
public ChartBackgroundColor(IsColor color)
Builds the object with the default background color for all charts.- Parameters:
color
- background default color for all charts.
-
ChartBackgroundColor
public ChartBackgroundColor(String color)
Builds the object with the default background color for all charts.- Parameters:
color
- background default color for all charts.
-
ChartBackgroundColor
public ChartBackgroundColor(Gradient gradient)
Builds the object with the default gradient for all charts.- Parameters:
gradient
- background default gradient for all charts.
-
ChartBackgroundColor
public ChartBackgroundColor(Pattern pattern)
Builds the object with the default pattern for all charts.- Parameters:
pattern
- background default pattern for all charts.
-
-
Method Detail
-
getColorAsString
public String getColorAsString()
Returns the color as string if it has been set, otherwisenull
.- Returns:
- the color as string if it has been set, otherwise
null
.
-
getColor
public IsColor getColor()
Returns the color if it has been set, otherwisenull
.- Returns:
- the color if it has been set, otherwise
null
-
getGradient
public Gradient getGradient()
Returns the gradient if it has been set, otherwisenull
.- Returns:
- the gradient if it has been set, otherwise
null
-
getPattern
public Pattern getPattern()
Returns the pattern if it has been set, otherwisenull
.- Returns:
- the pattern if it has been set, otherwise
null
-
loadPlugin
public void loadPlugin(PluginsEnvelop<SmartPlugin> envelop)
Description copied from interface:SmartPluginContainer
Loads the plugin to the envelop in order to pass it without exposing the methods.- Specified by:
loadPlugin
in interfaceSmartPluginContainer
- Parameters:
envelop
- envelop where the plugin instance must be stored.
-
-