Package org.pepstock.charba.client
Class Charts
- java.lang.Object
-
- org.pepstock.charba.client.Charts
-
public final class Charts extends Object
Is a static reference which collects all chart instances to be able to enable global plugins.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addLifecycleListener(ChartsLifecycleListener listener)
Adds new charts life cycle listener instance in the collection.static IsChart
get(String chartId)
Returns the chart instance by its id.static Chart
getNative(String chartId)
Returns the CHART.JS chart instance by id.static Chart
getNative(IsChart chart)
Returns the CHART.JS chart instance by chart instance.static boolean
hasNative(String chartId)
Returnstrue
if there is a CHART.JS chart instance by id.static boolean
hasNative(IsChart chart)
Returnstrue
if there is a CHART.JS chart instance by chart instance.static void
removeLifecycleListener(ChartsLifecycleListener listener)
Removes a charts life cycle listener instance from collection.
-
-
-
Method Detail
-
addLifecycleListener
public static void addLifecycleListener(ChartsLifecycleListener listener)
Adds new charts life cycle listener instance in the collection.- Parameters:
listener
- chart life cycle listener instance
-
removeLifecycleListener
public static void removeLifecycleListener(ChartsLifecycleListener listener)
Removes a charts life cycle listener instance from collection.- Parameters:
listener
- chart life cycle listener instance
-
get
public static IsChart get(String chartId)
Returns the chart instance by its id.- Parameters:
chartId
- chart id- Returns:
- chart instance or
null
if not exist.
-
hasNative
public static boolean hasNative(IsChart chart)
Returnstrue
if there is a CHART.JS chart instance by chart instance.- Parameters:
chart
- chart instance- Returns:
true
if there is a CHART.JS chart instance by chart instance
-
hasNative
public static boolean hasNative(String chartId)
Returnstrue
if there is a CHART.JS chart instance by id.- Parameters:
chartId
- chart id- Returns:
true
if there is a CHART.JS chart instance by id
-
getNative
public static Chart getNative(IsChart chart)
Returns the CHART.JS chart instance by chart instance.- Parameters:
chart
- chart instance- Returns:
- CHART.JS chart instance or
null
if not exist.
-
-