Class ChartBackgroundColor

  • All Implemented Interfaces:
    Plugin

    public final class ChartBackgroundColor
    extends AbstractPlugin
    A plugin implementation to set the background color, gradient or pattern of chart.
    If added to defaults, without any configuration, the chart will have a DEFAULT_BACKGROUND_COLOR background color.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • ChartBackgroundColor

        public ChartBackgroundColor()
        Default constructor with DEFAULT_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, otherwise null.
        Returns:
        the color as string if it has been set, otherwise null.
      • getColor

        public IsColor getColor()
        Returns the color if it has been set, otherwise null.
        Returns:
        the color if it has been set, otherwise null
      • getGradient

        public Gradient getGradient()
        Returns the gradient if it has been set, otherwise null.
        Returns:
        the gradient if it has been set, otherwise null
      • getPattern

        public Pattern getPattern()
        Returns the pattern if it has been set, otherwise null.
        Returns:
        the pattern if it has been set, otherwise null
      • onBeforeDraw

        public boolean onBeforeDraw​(IsChart chart)
        Description copied from interface: Plugin
        Called before drawing 'chart' at every animation frame.
        If any plugin returns false, the frame drawing is cancelled until another 'render' is triggered.
        Parameters:
        chart - the chart instance.
        Returns:
        false to cancel the chart drawing.
      • onEndDrawing

        public void onEndDrawing​(IsChart chart)
        Description copied from interface: Plugin
        Called after every drawing cycle, coming from initialization, updating or rendering of chart.
        Parameters:
        chart - the chart instance
      • onResize

        public void onResize​(IsChart chart,
                             PluginResizeArgument argument)
        Description copied from interface: Plugin
        Called after the chart as been resized.
        Parameters:
        chart - the chart instance.
        argument - argument of method which contains the new canvas display size (eq. canvas.style width and height).
      • onDestroy

        public void onDestroy​(IsChart chart)
        Description copied from interface: Plugin
        Called after the chart as been destroyed.
        Parameters:
        chart - the chart instance.