Interface IsChart

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      HandlerRegistration addHandler​(EventHandler handler, EventType type)
      Adds this handler to the widget.
      static <T extends IsChart>
      T
      checkAndGetIfConsistent​(T chart)
      Check if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
      If not, throw a IllegalArgumentException or returns the chart instance.
      static IsChart checkAndGetIfValid​(IsChart chart)
      Check if chart passed as argument is not null and its id is not null as well.
      If not, throw a IllegalArgumentException or returns the chart instance.
      void checkAxes​(Axis... axes)
      Checks if axes, requested to be stored, are an acceptable type or amount.
      If a axis type or the amount of axes are not consistent for the chart, a IllegalArgumentException will be thrown.
      void checkDatasets​(Dataset... datasets)
      Checks if datasets, requested to be stored, are an acceptable type or amount.
      If a dataset type or the amount of datasets are not consistent for the chart, a IllegalArgumentException will be thrown.
      static void checkIfConsistent​(IsChart chart)
      Check if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
      If not, throw a IllegalArgumentException.
      static void checkIfValid​(IsChart chart)
      Checks if chart passed as argument is not null and its id is not null as well.
      If not, throw a IllegalArgumentException.
      void clear()
      Will clear the chart canvas.
      void createAndSetTimer​(ChartTimerTask task, int interval)
      Creates a CTimer instance inside chart.
      It can be created only once during the life cycle of the chart.
      void destroy()
      Use this to destroy any chart instances that are created.
      void draw()
      Draws the chart
      void fireEvent​(Event event)
      Fires the event to the handlers.
      List<ActiveDatasetElement> getActiveElements()
      Returns the active (hovered) elements for the chart.
      Type getBaseType()
      Returns the base type of chart that in case of ChartType is the same of getType() otherwise, in case the type of the chart is a ControllerType is the chart type extension if there is or null.
      Canvas getCanvas()
      Returns the canvas element used to draw the chart.
      Div getChartElement()
      Gets a handle to the object's underlying DOM element.
      Data getData()
      Returns the data object with all passed datasets.
      List<DatasetReference> getDatasetAtEvent​(NativeBaseEvent event)
      Looks for the dataset that matches the event.
      DatasetItem getDatasetItem​(int index)
      Looks for the dataset that matches the current index and returns.
      NativeObjectContainerFactory<DatasetReference> getDatasetReferenceFactory()
      Returns the factory to create DatasetReference when required, based on the data element type of the chart.
      IsDefaultScaledOptions getDefaultChartOptions()
      Returns the default options created based on chart type.
      int getDrawCount()
      Returns the draw count of the chart.
      DatasetReference getElementAtEvent​(NativeBaseEvent event)
      Calling on your chart instance passing an argument of an event, will return the single element at the event position.
      If there are multiple items within range, only the first is returned.
      DatasetReference getElementAtEvent​(NativeBaseEvent event, InteractionOptions interaction)
      Calling on your chart instance passing an argument of an event, will return the single element at the event position.
      If there are multiple items within range, only the first is returned.
      List<DatasetReference> getElementsAtEvent​(NativeBaseEvent event)
      Looks for the element under the event point, then returns all elements at the same data index.
      Calling it on your chart instance passing an argument of an event, will return the point elements that are at that the same position of that event.
      List<DatasetReference> getElementsAtEvent​(NativeBaseEvent event, InteractionOptions interaction)
      Looks for the element under the event point, then returns all elements at the same data index.
      Calling it on your chart instance passing an argument of an event, will return the point elements that are at that the same position of that event.
      int getHandlerCount​(EventType type)
      Returns the amount of handlers for a specific event type.
      String getId()
      Returns the ID of chart.
      It could be considered as chart unique ID.
      CursorType getInitialCursor()
      Returns the initial cursor of the chart.
      ChartNode getNode()
      Returns the chart node with runtime data.
      ConfigurationOptions getOptions()
      Returns the options of chart.
      Plugins getPlugins()
      Returns the plugins element to manage inline plugins.
      List<DatasetItem> getSortedVisibleDatasetItems()
      Returns an array of all the dataset items in the order that they are drawn on the canvas that are not hidden.
      CTimer getTimer()
      Returns a CTimer instance inside chart.
      List<ActiveDatasetElement> getTooltipActiveElements()
      Returns the active tooltip elements for the chart.
      Type getType()
      Returns the type of chart.
      int getVisibleDatasetCount()
      Returns the amount of datasets which are visible
      IsDefaultScaledOptions getWholeOptions()
      Returns the default options by a chart instance, merging global, chart type global and chart options.
      void hide​(int datasetIndex)
      Sets the visibility for the given dataset to false.
      Updates the chart and animates the dataset with 'hide' mode.
      This animation can be configured under the hide key in animation options.
      void hide​(int datasetIndex, int dataIndex)
      Sets the hidden flag of that element index to true and updates the chart.
      static boolean isAbstractChart​(IsChart chart)
      Returns true if chart passed as argument is an abstract chart instance.
      boolean isChartAttached()
      Returns true whether this chart is currently attached to the browser's document.
      static boolean isConsistent​(IsChart chart)
      Returns true if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
      boolean isDatasetVisible​(int index)
      Looks for the dataset if it's visible or not, selected by index.
      boolean isDataVisible​(int index)
      Returns the stored visibility state of an data index for all datasets.
      boolean isDestroyOnDetach()
      Returns true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
      boolean isDrawOnAttach()
      Returns true if the chart is configured to be drawn on the attach of DIV element, otherwise false.
      boolean isEventHandled​(EventType type)
      Returns true if there is any event handler for event type passed as argument.
      boolean isInitialized()
      Returns true if CHART.JS chart has been initialized, otherwise false.
      boolean isPluginEnabled​(String pluginId)
      Check if a plugin with the specific ID is registered and enabled.
      static boolean isValid​(IsChart chart)
      Returns true if chart passed as argument is not null and its id is not null as well.
      void reconfigure()
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update the options, mutating the options property in place.
      void reconfigure​(TransitionMode mode)
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update the options, mutating the options property in place.
      A animation mode key can be provided for the update process using a specific animation configuration.
      This is useful when update is manually called inside an event handler and some different animation is desired.
      void reconfigure​(UpdateConfiguration config)
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update the options, mutating the options property in place.
      A configuration object can be provided with additional configuration for the update process.
      This is useful when update is manually called inside an event handler and some different animation is desired.
      void removeCanvasPreventDefault()
      Remove the registration of prevent default mouse listener from canvas.
      This is necessary when you will add your mouse down listener.
      void render()
      Triggers a redraw of all chart elements.
      Note, this does not update elements for new data.
      void reset()
      Reset the chart to it's state before the initial animation.
      void resetActiveElements()
      Resets the active (hovered) elements for the chart.
      void resetTooltipActiveElements()
      Resets the active tooltip elements for the chart.
      void resize()
      Use this to manually resize the canvas element.
      void resize​(int width, int height)
      Use this to manually resize the canvas element.
      This is run each time the canvas container is resized, but can be called this method manually if you change the size of the canvas nodes container element.
      void setActiveElements​(List<ActiveDatasetElement> elements)
      Sets the active (hovered) elements for the chart.
      void setActiveElements​(ActiveDatasetElement... elements)
      Sets the active (hovered) elements for the chart.
      void setDatasetVisibility​(int datasetIndex, boolean visibility)
      Sets the visibility for a given dataset.
      This can be used to build a chart legend in HTML.
      During click on one of the HTML items, you can call it to change the appropriate dataset.
      void setDestroyOnDetach​(boolean destroyOnDetach)
      Sets true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
      void setDrawOnAttach​(boolean drawOnAttach)
      Sets true if the chart is configured to be draw on the attach of DIV element, otherwise false.
      void setTooltipActiveElements​(List<ActiveDatasetElement> elements)
      Sets the active tooltip elements for the chart.
      void setTooltipActiveElements​(IsPoint point, List<ActiveDatasetElement> elements)
      Sets the active tooltip elements for the chart.
      void setTooltipActiveElements​(IsPoint point, ActiveDatasetElement... elements)
      Sets the active tooltip elements for the chart.
      void setTooltipActiveElements​(ActiveDatasetElement... elements)
      Sets the active tooltip elements for the chart.
      void show​(int datasetIndex)
      Sets the visibility for the given dataset to true.
      Updates the chart and animates the dataset with 'show' mode.
      This animation can be configured under the show key in animation options.
      void show​(int datasetIndex, int dataIndex)
      Sets the hidden flag of that element index to false and updates the chart.
      void stop()
      Use this to stop any current animation loop.
      default String toBase64Image()
      Returns a data-URL containing a representation of the image in the PNG format and the image quality value is 0.92.
      default String toBase64Image​(double encoderOptions)
      Returns a data-URL containing a representation of the image in the PNG format.
      The returned image is in a resolution of 96dpi.
      default String toBase64Image​(ImageMimeType type)
      Returns a data-URL containing a representation of the image format, passed as argument.
      The returned image is in a resolution of 96dpi and the image quality value is 0.92.
      String toBase64Image​(ImageMimeType type, double encoderOptions)
      Returns a base 64 encoded string of the chart in it's current state.
      void toggleDataVisibility​(int index)
      Toggles the visibility of an item in all datasets.
      A dataset needs to explicitly support this feature for it to have an effect.
      From internal chart types, doughnut / pie and polar area use this.
      void update()
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update all scales, legends, and then re-render the chart.
      void update​(TransitionMode mode)
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update all scales, legends, and then re-render the chart.
      A config object can be provided with additional configuration for the update process.
      This is useful when update is manually called inside an event handler and some different animation is desired.
      void update​(UpdateConfiguration config)
      Triggers an update of the chart.
      This can be safely called after updating the data object.
      This will update all scales, legends, and then re-render the chart.
      A config object can be provided with additional configuration for the update process.
      This is useful when update is manually called inside an event handler and some different animation is desired.
    • Method Detail

      • isConsistent

        static boolean isConsistent​(IsChart chart)
        Returns true if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
        Parameters:
        chart - chart to be checked
        Returns:
        true if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
      • checkIfConsistent

        static void checkIfConsistent​(IsChart chart)
        Check if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
        If not, throw a IllegalArgumentException.
        Parameters:
        chart - chart to be checked
      • checkAndGetIfConsistent

        static <T extends IsChart> T checkAndGetIfConsistent​(T chart)
        Check if chart passed as argument is not null and its id is not null as well, and if mandatory methods of interface will return consistent instances.
        If not, throw a IllegalArgumentException or returns the chart instance.
        Type Parameters:
        T - type of the chart instance
        Parameters:
        chart - chart to be checked
        Returns:
        the chart instance passed as argument
      • isValid

        static boolean isValid​(IsChart chart)
        Returns true if chart passed as argument is not null and its id is not null as well.
        Parameters:
        chart - chart to be checked
        Returns:
        true if chart passed as argument is not null and its id is not null as well
      • checkIfValid

        static void checkIfValid​(IsChart chart)
        Checks if chart passed as argument is not null and its id is not null as well.
        If not, throw a IllegalArgumentException.
        Parameters:
        chart - chart to be checked
      • checkAndGetIfValid

        static IsChart checkAndGetIfValid​(IsChart chart)
        Check if chart passed as argument is not null and its id is not null as well.
        If not, throw a IllegalArgumentException or returns the chart instance.
        Parameters:
        chart - chart to be checked
        Returns:
        the chart instance passed as argument
      • isAbstractChart

        static boolean isAbstractChart​(IsChart chart)
        Returns true if chart passed as argument is an abstract chart instance.
        Parameters:
        chart - chart to be checked
        Returns:
        true if chart passed as argument is an abstract chart instance
      • addHandler

        HandlerRegistration addHandler​(EventHandler handler,
                                       EventType type)
        Adds this handler to the widget.
        Parameters:
        type - the event type
        handler - the handler
        Returns:
        handler registration used to remove the handler
      • fireEvent

        void fireEvent​(Event event)
        Fires the event to the handlers.
        Parameters:
        event - the event to fire
      • getHandlerCount

        int getHandlerCount​(EventType type)
        Returns the amount of handlers for a specific event type.
        Parameters:
        type - event type to use to get the amount of handlers
        Returns:
        the amount of handlers for a specific event type
      • isEventHandled

        boolean isEventHandled​(EventType type)
        Returns true if there is any event handler for event type passed as argument.
        Parameters:
        type - event type to check
        Returns:
        true if there is any event handler for event type passed as argument
      • getChartElement

        Div getChartElement()
        Gets a handle to the object's underlying DOM element.
        Returns:
        the object's browser element
      • isChartAttached

        boolean isChartAttached()
        Returns true whether this chart is currently attached to the browser's document.
        Returns:
        true whether this chart is currently attached to the browser's document
      • getOptions

        ConfigurationOptions getOptions()
        Returns the options of chart.
        Returns:
        the options of chart.
      • getType

        Type getType()
        Returns the type of chart.
        Returns:
        the type of chart.
      • getBaseType

        Type getBaseType()
        Returns the base type of chart that in case of ChartType is the same of getType() otherwise, in case the type of the chart is a ControllerType is the chart type extension if there is or null.
        Returns:
        the base type of chart.
      • getId

        String getId()
        Returns the ID of chart.
        It could be considered as chart unique ID.
        Returns:
        the ID of chart
      • getDrawCount

        int getDrawCount()
        Returns the draw count of the chart.
        Returns:
        the draw count of the chart
      • getCanvas

        Canvas getCanvas()
        Returns the canvas element used to draw the chart.
        Returns:
        the canvas
      • removeCanvasPreventDefault

        void removeCanvasPreventDefault()
        Remove the registration of prevent default mouse listener from canvas.
        This is necessary when you will add your mouse down listener.
      • getInitialCursor

        CursorType getInitialCursor()
        Returns the initial cursor of the chart.
        Returns:
        the initial cursor of the chart.
      • isInitialized

        boolean isInitialized()
        Returns true if CHART.JS chart has been initialized, otherwise false.
        Returns:
        true if CHART.JS chart has been initialized, otherwise false.
      • getNode

        ChartNode getNode()
        Returns the chart node with runtime data.
        Returns:
        the chart node.
      • getData

        Data getData()
        Returns the data object with all passed datasets.
        Returns:
        the data configuration object
      • getPlugins

        Plugins getPlugins()
        Returns the plugins element to manage inline plugins.
        Returns:
        the plugins configuration object
      • getDefaultChartOptions

        IsDefaultScaledOptions getDefaultChartOptions()
        Returns the default options created based on chart type.
        Returns:
        the default options of the chart
      • getWholeOptions

        IsDefaultScaledOptions getWholeOptions()
        Returns the default options by a chart instance, merging global, chart type global and chart options.
        Returns:
        the default options by a chart instance, merging global, chart type global and chart options
      • getTimer

        CTimer getTimer()
        Returns a CTimer instance inside chart.
        Returns:
        the timer instance of the chart
      • createAndSetTimer

        void createAndSetTimer​(ChartTimerTask task,
                               int interval)
        Creates a CTimer instance inside chart.
        It can be created only once during the life cycle of the chart.
        Parameters:
        task - the task to be executed repeatedly
        interval - the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.
        Must be greater than 0.
      • isDrawOnAttach

        boolean isDrawOnAttach()
        Returns true if the chart is configured to be drawn on the attach of DIV element, otherwise false.
        Returns:
        the drawOnAttach true if the chart is configured to be drawn on the attach of DIV element, otherwise false.
      • setDrawOnAttach

        void setDrawOnAttach​(boolean drawOnAttach)
        Sets true if the chart is configured to be draw on the attach of DIV element, otherwise false.
        Parameters:
        drawOnAttach - the drawOnAttach to set
      • isDestroyOnDetach

        boolean isDestroyOnDetach()
        Returns true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
        Returns:
        the destroyOnDetach true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
      • setDestroyOnDetach

        void setDestroyOnDetach​(boolean destroyOnDetach)
        Sets true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
        Parameters:
        destroyOnDetach - the destroyOnDetach to set
      • setActiveElements

        void setActiveElements​(List<ActiveDatasetElement> elements)
        Sets the active (hovered) elements for the chart.
        Parameters:
        elements - list of active elements
      • setActiveElements

        void setActiveElements​(ActiveDatasetElement... elements)
        Sets the active (hovered) elements for the chart.
        Parameters:
        elements - array of active elements
      • resetActiveElements

        void resetActiveElements()
        Resets the active (hovered) elements for the chart.
      • getActiveElements

        List<ActiveDatasetElement> getActiveElements()
        Returns the active (hovered) elements for the chart.
        Returns:
        the list of active elements
      • setTooltipActiveElements

        void setTooltipActiveElements​(List<ActiveDatasetElement> elements)
        Sets the active tooltip elements for the chart.
        Parameters:
        elements - list of active tooltip elements
      • setTooltipActiveElements

        void setTooltipActiveElements​(IsPoint point,
                                      List<ActiveDatasetElement> elements)
        Sets the active tooltip elements for the chart.
        Parameters:
        point - synthetic event position used in positioning
        elements - list of active tooltip elements
      • resetTooltipActiveElements

        void resetTooltipActiveElements()
        Resets the active tooltip elements for the chart.
      • setTooltipActiveElements

        void setTooltipActiveElements​(ActiveDatasetElement... elements)
        Sets the active tooltip elements for the chart.
        Parameters:
        elements - array of active tooltip elements
      • setTooltipActiveElements

        void setTooltipActiveElements​(IsPoint point,
                                      ActiveDatasetElement... elements)
        Sets the active tooltip elements for the chart.
        Parameters:
        point - synthetic event position used in positioning
        elements - array of active tooltip elements
      • getTooltipActiveElements

        List<ActiveDatasetElement> getTooltipActiveElements()
        Returns the active tooltip elements for the chart.
        Returns:
        the array of active tooltip elements
      • destroy

        void destroy()
        Use this to destroy any chart instances that are created. This will clean up any references stored to the chart object within Chart.js, along with any associated event listeners attached by Chart.js.
      • stop

        void stop()
        Use this to stop any current animation loop. This will pause the chart during any current animation frame. Call .render() to re-animate.
      • clear

        void clear()
        Will clear the chart canvas. Used extensively internally between animation frames.
      • reset

        void reset()
        Reset the chart to it's state before the initial animation. A new animation can then be triggered using update.
      • toBase64Image

        default String toBase64Image()
        Returns a data-URL containing a representation of the image in the PNG format and the image quality value is 0.92.
        Returns:
        a data-URL containing a representation of the image in the PNG format
      • toBase64Image

        default String toBase64Image​(double encoderOptions)
        Returns a data-URL containing a representation of the image in the PNG format.
        The returned image is in a resolution of 96dpi.
        Parameters:
        encoderOptions - between 0 and 1 indicating the image quality to use for image formats that use lossy compression.
        If this argument is anything else, the default value for image quality is used. The default value is 0.92.
        Returns:
        a data-URL containing a representation of the image in the PNG format
      • toBase64Image

        default String toBase64Image​(ImageMimeType type)
        Returns a data-URL containing a representation of the image format, passed as argument.
        The returned image is in a resolution of 96dpi and the image quality value is 0.92.
        Parameters:
        type - indicating the image format
        Returns:
        a data-URL containing a representation of the image format, passed as argument
      • toBase64Image

        String toBase64Image​(ImageMimeType type,
                             double encoderOptions)
        Returns a base 64 encoded string of the chart in it's current state.
        Parameters:
        type - indicating the image format
        encoderOptions - between 0 and 1 indicating the image quality to use for image formats that use lossy compression.
        If this argument is anything else, the default value for image quality is used. The default value is 0.92.
        Returns:
        base 64 image or Undefined.STRING if chart is not initialized.
      • resize

        void resize()
        Use this to manually resize the canvas element. This is run each time the canvas container is resized, but can be called this method manually if you change the size of the canvas nodes container element.
      • resize

        void resize​(int width,
                    int height)
        Use this to manually resize the canvas element.
        This is run each time the canvas container is resized, but can be called this method manually if you change the size of the canvas nodes container element.
        Parameters:
        width - width size of resize
        height - height size of resize
      • update

        void update()
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update all scales, legends, and then re-render the chart.
      • update

        void update​(TransitionMode mode)
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update all scales, legends, and then re-render the chart.
        A config object can be provided with additional configuration for the update process.
        This is useful when update is manually called inside an event handler and some different animation is desired.
        Parameters:
        mode - an animation mode can be provided to indicate what should be updated and what animation configuration should be used
      • update

        void update​(UpdateConfiguration config)
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update all scales, legends, and then re-render the chart.
        A config object can be provided with additional configuration for the update process.
        This is useful when update is manually called inside an event handler and some different animation is desired.
        Parameters:
        config - a config object can be provided with additional configuration for the update process
      • reconfigure

        void reconfigure()
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update the options, mutating the options property in place.
      • reconfigure

        void reconfigure​(TransitionMode mode)
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update the options, mutating the options property in place.
        A animation mode key can be provided for the update process using a specific animation configuration.
        This is useful when update is manually called inside an event handler and some different animation is desired.
        Parameters:
        mode - an animation mode can be provided to indicate what should be updated and what animation configuration should be used
      • reconfigure

        void reconfigure​(UpdateConfiguration config)
        Triggers an update of the chart.
        This can be safely called after updating the data object.
        This will update the options, mutating the options property in place.
        A configuration object can be provided with additional configuration for the update process.
        This is useful when update is manually called inside an event handler and some different animation is desired.
        Parameters:
        config - a configuration object can be provided with additional configuration for the update process
      • render

        void render()
        Triggers a redraw of all chart elements.
        Note, this does not update elements for new data. Use .update() in that case.
      • getDatasetItem

        DatasetItem getDatasetItem​(int index)
        Looks for the dataset that matches the current index and returns.
        Parameters:
        index - dataset index
        Returns:
        dataset item.
      • getSortedVisibleDatasetItems

        List<DatasetItem> getSortedVisibleDatasetItems()
        Returns an array of all the dataset items in the order that they are drawn on the canvas that are not hidden.
        Returns:
        an array of all the dataset items in the order that they are drawn on the canvas that are not hidden.
      • getDatasetAtEvent

        List<DatasetReference> getDatasetAtEvent​(NativeBaseEvent event)
        Looks for the dataset that matches the event.
        Parameters:
        event - event of chart.
        Returns:
        dataset item.
      • isDatasetVisible

        boolean isDatasetVisible​(int index)
        Looks for the dataset if it's visible or not, selected by index.
        Parameters:
        index - dataset index
        Returns:
        true if dataset is visible otherwise false.
      • getVisibleDatasetCount

        int getVisibleDatasetCount()
        Returns the amount of datasets which are visible
        Returns:
        the amount of datasets which are visible. If chart is not initialized, return Undefined.INTEGER.
      • setDatasetVisibility

        void setDatasetVisibility​(int datasetIndex,
                                  boolean visibility)
        Sets the visibility for a given dataset.
        This can be used to build a chart legend in HTML.
        During click on one of the HTML items, you can call it to change the appropriate dataset.
        Parameters:
        datasetIndex - dataset index
        visibility - if true enables the visibility otherwise false
      • toggleDataVisibility

        void toggleDataVisibility​(int index)
        Toggles the visibility of an item in all datasets.
        A dataset needs to explicitly support this feature for it to have an effect.
        From internal chart types, doughnut / pie and polar area use this.
        Parameters:
        index - data index
      • isDataVisible

        boolean isDataVisible​(int index)
        Returns the stored visibility state of an data index for all datasets.
        Parameters:
        index - data index
        Returns:
        true if the data item is visible
      • hide

        void hide​(int datasetIndex)
        Sets the visibility for the given dataset to false.
        Updates the chart and animates the dataset with 'hide' mode.
        This animation can be configured under the hide key in animation options.
        Parameters:
        datasetIndex - dataset index
      • hide

        void hide​(int datasetIndex,
                  int dataIndex)
        Sets the hidden flag of that element index to true and updates the chart.
        Parameters:
        datasetIndex - dataset index
        dataIndex - data index
      • show

        void show​(int datasetIndex)
        Sets the visibility for the given dataset to true.
        Updates the chart and animates the dataset with 'show' mode.
        This animation can be configured under the show key in animation options.
        Parameters:
        datasetIndex - dataset index
      • show

        void show​(int datasetIndex,
                  int dataIndex)
        Sets the hidden flag of that element index to false and updates the chart.
        Parameters:
        datasetIndex - dataset index
        dataIndex - data index
      • getElementAtEvent

        DatasetReference getElementAtEvent​(NativeBaseEvent event)
        Calling on your chart instance passing an argument of an event, will return the single element at the event position.
        If there are multiple items within range, only the first is returned.
        Parameters:
        event - event of chart.
        Returns:
        single element at the event position or null.
      • getElementAtEvent

        DatasetReference getElementAtEvent​(NativeBaseEvent event,
                                           InteractionOptions interaction)
        Calling on your chart instance passing an argument of an event, will return the single element at the event position.
        If there are multiple items within range, only the first is returned.
        Parameters:
        event - event of chart.
        interaction - how the elements will be checked.
        Returns:
        single element at the event position or null if event is not consistent
      • getElementsAtEvent

        List<DatasetReference> getElementsAtEvent​(NativeBaseEvent event)
        Looks for the element under the event point, then returns all elements at the same data index.
        Calling it on your chart instance passing an argument of an event, will return the point elements that are at that the same position of that event.
        Parameters:
        event - event of chart.
        Returns:
        all elements at the same data index or an empty list.
      • getElementsAtEvent

        List<DatasetReference> getElementsAtEvent​(NativeBaseEvent event,
                                                  InteractionOptions interaction)
        Looks for the element under the event point, then returns all elements at the same data index.
        Calling it on your chart instance passing an argument of an event, will return the point elements that are at that the same position of that event.
        Parameters:
        event - event of chart.
        interaction - how the elements will be checked.
        Returns:
        all elements at the same data index or an empty list.
      • draw

        void draw()
        Draws the chart
      • isPluginEnabled

        boolean isPluginEnabled​(String pluginId)
        Check if a plugin with the specific ID is registered and enabled.
        Parameters:
        pluginId - the ID of the plugin of which to check if it is enabled
        Returns:
        boolean returns true if plugin is registered and enabled
      • checkDatasets

        void checkDatasets​(Dataset... datasets)
        Checks if datasets, requested to be stored, are an acceptable type or amount.
        If a dataset type or the amount of datasets are not consistent for the chart, a IllegalArgumentException will be thrown.
        Parameters:
        datasets - list of datasets to check.
      • checkAxes

        void checkAxes​(Axis... axes)
        Checks if axes, requested to be stored, are an acceptable type or amount.
        If a axis type or the amount of axes are not consistent for the chart, a IllegalArgumentException will be thrown.
        Parameters:
        axes - list of axes to check.