public final class Defaults extends Object
defaults
object that CHART.JS (by CHART object) provides to get defaults values.Modifier and Type | Field and Description |
---|---|
static String |
ID
Plugin ID "charbanativecharthandler", for an internal plugin to track native chart instances.
|
Modifier and Type | Method and Description |
---|---|
List<LegendLabelItem> |
generateLabels(Chart chart)
Returns an unmodifiable list of legend labels for that chart with the callback provided by CHART.JS out of the box.
|
List<LegendLabelItem> |
generateLabels(IsChart chart)
Returns an unmodifiable list of legend labels for that chart with the callback provided by CHART.JS out of the box.
|
String |
generateLegend(IsChart chart)
Returns an HTML string of a legend for that chart with the callback provided by CHART.JS out of the box.
|
static Defaults |
get()
Singleton method to get static instance.
|
Controllers |
getControllers()
Returns the controllers.
|
GlobalOptions |
getGlobal()
Returns the global options.
|
ChartOptions |
getOptions(Type type)
Returns the default options by a chart type, by defaults of CHART.JS.
If the type is not consistent, throws an exception. |
GlobalPlugins |
getPlugins()
Returns the global plugins manager.
|
GlobalScale |
getScale()
Returns the global scale.
|
GlobalScale |
getScale(AxisType axisType)
Returns the global scale by axis type.
|
void |
invokeChartOnClick(ChartClickEvent event)
Invokes the
onClick chart function provided out of the box by CHART.JS. |
void |
invokeChartOnHover(ChartHoverEvent event)
Invokes the
onHover chart function provided out of the box by CHART.JS. |
void |
invokeLegendOnClick(LegendClickEvent event)
Invokes the
onClick legend function provided out of the box by CHART.JS. |
void |
invokeLegendOnHover(LegendHoverEvent event)
Invokes the
onHover legend function provided out of the box by CHART.JS. |
void |
invokeLegendOnLeave(LegendLeaveEvent event)
Invokes the
onLeave legend function provided out of the box by CHART.JS. |
void |
updateScale(AxisType axisType)
Update the global scale by axis type.
|
public static final String ID
public static Defaults get()
public GlobalOptions getGlobal()
public GlobalScale getScale()
public GlobalScale getScale(AxisType axisType)
axisType
- the axis type to use to get defaults.public void updateScale(AxisType axisType)
axisType
- the axis type to use to set defaults.public GlobalPlugins getPlugins()
public Controllers getControllers()
public ChartOptions getOptions(Type type)
type
- chart type.public String generateLegend(IsChart chart)
chart
- chart instance to use to get default HTML legendUndefinedValues.STRING
if chart is not initialized.public List<LegendLabelItem> generateLabels(Chart chart)
chart
- chart instance to use to get legend labelspublic List<LegendLabelItem> generateLabels(IsChart chart)
chart
- chart instance to use to get legend labelspublic void invokeChartOnClick(ChartClickEvent event)
onClick
chart function provided out of the box by CHART.JS.event
- original event generated to invoke a chart click handler.public void invokeChartOnHover(ChartHoverEvent event)
onHover
chart function provided out of the box by CHART.JS.event
- original event generated to invoke a chart hover handler.public void invokeLegendOnClick(LegendClickEvent event)
onClick
legend function provided out of the box by CHART.JS.event
- original event generated to invoke a legend click handler.public void invokeLegendOnHover(LegendHoverEvent event)
onHover
legend function provided out of the box by CHART.JS.event
- original event generated to invoke a legend hover handler.public void invokeLegendOnLeave(LegendLeaveEvent event)
onLeave
legend function provided out of the box by CHART.JS.event
- original event generated to invoke a legend leave handler.