Class 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 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)
        Returns true 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)
        Returns true 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.
      • getNative

        public static Chart getNative​(String chartId)
        Returns the CHART.JS chart instance by id.
        Parameters:
        chartId - chart id
        Returns:
        CHART.JS chart instance or null if not exist.