Class Options

    • Constructor Detail

      • Options

        protected Options​(String scope,
                          IsDefaultOptions defaultValues)
        Creates the object only with default provider. This is used as the root element.
        New native java script object is created and it's empty.
        Parameters:
        scope - scope of the options
        defaultValues - default provider instance.
      • Options

        protected Options​(String scope,
                          IsDefaultOptions defaultValues,
                          NativeObject nativeObject)
        Creates the object only with default provider and native object. This is used as the root element.
        Parameters:
        scope - scope of the options
        defaultValues - default provider instance.
        nativeObject - native object to store properties.
    • Method Detail

      • getFont

        public final Font getFont()
        Returns the font element.
        Specified by:
        getFont in interface IsDefaultOptions
        Returns:
        the font
      • getSpanGapHandler

        public final SpanGapHandler getSpanGapHandler()
        Description copied from interface: HasSpanGaps
        Returns a span gap handler instance to use in the default methods of this interface.
        Specified by:
        getSpanGapHandler in interface HasSpanGaps
        Returns:
        a span gap handler instance
      • getEventsOptionHandler

        public final EventsOptionHandler getEventsOptionHandler()
        Description copied from interface: HasEvents
        Returns a event handler handler instance to use in the default methods of this interface.
        Specified by:
        getEventsOptionHandler in interface HasEvents
        Returns:
        a event handler handler instance
      • getScope

        public final String getScope()
        Returns the scope of the options, which is the options are used for defaults, chart defaults or chart.
        Specified by:
        getScope in interface HasCallbackScope
        Returns:
        the scope of the options
      • getDecimation

        public final Decimation getDecimation()
        Returns the decimation plugin element.
        Specified by:
        getDecimation in interface IsDefaultOptions
        Returns:
        the decimation plugin element
      • getFiller

        public final Filler getFiller()
        Returns the filler plugin element.
        Specified by:
        getFiller in interface IsDefaultOptions
        Returns:
        the filler plugin element
      • getCharbaId

        public String getCharbaId()
        Returns the CHARBA id when the options are related to a chart instance.
        Returns:
        the CHARBA id when the options are related to a chart instance otherwise Undefined.STRING.
      • setLocale

        public void setLocale​(CLocale locale)
        Sets the locale instance for internationalization.
        Parameters:
        locale - the locale instance
      • getLocale

        public CLocale getLocale()
        Returns the locale instance for internationalization.
        Specified by:
        getLocale in interface IsDefaultOptions
        Returns:
        the locale instance
      • setResponsive

        public void setResponsive​(boolean responsive)
        Sets the resizing of the chart canvas when its container does.
        Parameters:
        responsive - the resizing of the chart canvas when its container does.
      • isResponsive

        public boolean isResponsive()
        Returns the resizing of the chart canvas when its container does.
        Specified by:
        isResponsive in interface IsDefaultOptions
        Returns:
        the resizing of the chart canvas when its container does.
      • setMaintainAspectRatio

        public void setMaintainAspectRatio​(boolean maintainAspectRatio)
        Sets the maintaining of the original canvas aspect ratio (width / height) when resizing.
        Parameters:
        maintainAspectRatio - the maintaining of the original canvas aspect ratio (width / height) when resizing.
      • isMaintainAspectRatio

        public boolean isMaintainAspectRatio()
        Returns the maintaining of the original canvas aspect ratio (width / height) when resizing.
        Specified by:
        isMaintainAspectRatio in interface IsDefaultOptions
        Returns:
        the maintaining of the original canvas aspect ratio (width / height) when resizing.
      • setAspectRatio

        public void setAspectRatio​(double ratio)
        Canvas aspect ratio (i.e. width / height, a value of 1 representing a square canvas).
        Note that this option is ignored if the height is explicitly defined either as attribute or via the style.
        Parameters:
        ratio - the aspect ratio.
      • getAspectRatio

        public double getAspectRatio()
        Canvas aspect ratio (i.e. width / height, a value of 1 representing a square canvas).
        Note that this option is ignored if the height is explicitly defined either as attribute or via the style.
        Specified by:
        getAspectRatio in interface IsDefaultOptions
        Returns:
        the aspect ratio.
      • setResizeDelay

        public void setResizeDelay​(int delay)
        Sets the delay the resize update by give amount of milliseconds.
        This can ease the resize process by debouncing update of the elements.
        Parameters:
        delay - the delay the resize update by give amount of milliseconds
      • getResizeDelay

        public double getResizeDelay()
        Returns the delay the resize update by give amount of milliseconds.
        This can ease the resize process by debouncing update of the elements.
        Specified by:
        getResizeDelay in interface IsDefaultOptions
        Returns:
        the delay the resize update by give amount of milliseconds
      • setDevicePixelRatio

        public void setDevicePixelRatio​(double ratio)
        The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g. Retina displays). Setting devicePixelRatio to a value other than 1 will force the canvas size to be scaled by that amount.
        Parameters:
        ratio - the pixel ratio.
      • getDevicePixelRatio

        public double getDevicePixelRatio()
        The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g. Retina displays). Setting devicePixelRatio to a value other than 1 will force the canvas size to be scaled by that amount. Returns the pixel ratio.
        Specified by:
        getDevicePixelRatio in interface IsDefaultOptions
        Returns:
        the pixel ratio.
      • isDrawOnAttach

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

        public 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

        public boolean isDestroyOnDetach()
        Returns true if the chart is configured to be destroyed on the detach from DIV element, otherwise false.
        Specified by:
        isDestroyOnDetach in interface IsDefaultOptions
        Returns:
        the destroyOnDetach true if the chart is configured to be destroyed on the attach of DIV element, otherwise false.
      • setDestroyOnDetach

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

        public void setColor​(IsColor color)
        Sets the default color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        color - color to use in the chart.
      • setColor

        public void setColor​(String color)
        Sets the default color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        color - color to use in the chart.
      • getColorAsString

        public String getColorAsString()
        Returns the default color to use in the chart, on all objects, if not override by the specific configuration.
        Specified by:
        getColorAsString in interface IsDefaultOptions
        Returns:
        color to use in the chart.
      • getColor

        public IsColor getColor()
        Returns the default color to use in the chart, on all objects, if not override by the specific configuration.
        Returns:
        color to use in the chart.
      • setBackgroundColor

        public void setBackgroundColor​(IsColor backgroundColor)
        Sets the default background color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        backgroundColor - background color to use in the chart.
      • setBackgroundColor

        public void setBackgroundColor​(String backgroundColor)
        Sets the default background color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        backgroundColor - background color to use in the chart.
      • getBackgroundColorAsString

        public String getBackgroundColorAsString()
        Returns the default background color to use in the chart, on all objects, if not override by the specific configuration.
        Specified by:
        getBackgroundColorAsString in interface IsDefaultOptions
        Returns:
        background color to use in the chart.
      • getBackgroundColor

        public IsColor getBackgroundColor()
        Returns the default background color to use in the chart, on all objects, if not override by the specific configuration.
        Returns:
        background color to use in the chart.
      • setBorderColor

        public void setBorderColor​(IsColor borderColor)
        Sets the default border color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        borderColor - border color to use in the chart.
      • setBorderColor

        public void setBorderColor​(String borderColor)
        Sets the default border color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        borderColor - border color to use in the chart.
      • getBorderColorAsString

        public String getBorderColorAsString()
        Returns the default border color to use in the chart, on all objects, if not override by the specific configuration.
        Specified by:
        getBorderColorAsString in interface IsDefaultOptions
        Returns:
        border color to use in the chart.
      • getBorderColor

        public IsColor getBorderColor()
        Returns the default border color to use in the chart, on all objects, if not override by the specific configuration.
        Returns:
        border color to use in the chart.
      • setAutoColors

        public void setAutoColors​(boolean enabled)
        Sets true when the auto colors plugin has been enabled and CHART.JS apply the default colors to datasets.
        Parameters:
        enabled - true when the auto colors plugin has been enabled and CHART.JS apply the default colors to datasets
      • isAutoColors

        public boolean isAutoColors()
        Returns true when the auto colors plugin has been enabled and CHART.JS apply the default colors to datasets.
        Specified by:
        isAutoColors in interface IsDefaultOptions
        Returns:
        true when the auto colors plugin has been enabled and CHART.JS apply the default colors to datasets
      • setAutoColorsForceOverride

        public void setAutoColorsForceOverride​(boolean forceOverride)
        By default the colors plugin only works when you initialize the chart without any colors for the border or background specified.
        If you want to force the colors plugin to always color your datasets, for example when using dynamic datasets at runtime you will need to set the forceOverride option to true.
        Parameters:
        forceOverride - true if auto color plugin forces setting palette.
      • isAutoColorsForceOverride

        public boolean isAutoColorsForceOverride()
        By default the colors plugin only works when you initialize the chart without any colors for the border or background specified.
        If you want to force the colors plugin to always color your datasets, for example when using dynamic datasets at runtime you will need to set the forceOverride option to true.
        Specified by:
        isAutoColorsForceOverride in interface IsDefaultOptions
        Returns:
        true if auto color plugin forces setting palette.
      • setShowLine

        public void setShowLine​(boolean showLine)
        If false, the lines between points are not drawn.
        Parameters:
        showLine - if false, the lines between points are not drawn.
      • isShowLine

        public boolean isShowLine()
        If false, the lines between points are not drawn.
        Specified by:
        isShowLine in interface IsDefaultOptions
        Returns:
        if false, the lines between points are not drawn.
      • setSkipNull

        public void setSkipNull​(boolean skipNull)
        If true, null or undefined values will not be drawn.
        Parameters:
        skipNull - if true, null or undefined values will not be drawn
      • isSkipNull

        public boolean isSkipNull()
        If true, null or undefined values will not be drawn.
        Specified by:
        isSkipNull in interface IsDefaultOptions
        Returns:
        If true, null or undefined values will not be drawn
      • setCutout

        public void setCutout​(double cutout)
        Sets the portion of the chart that is cut out of the middle.
        As Double, it is considered to be pixels.
        Parameters:
        cutout - the portion of the chart that is cut out of the middle.
        As Double, it is considered to be pixels.
      • getCutout

        public double getCutout()
        Returns the portion of the chart that is cut out of the middle.
        As Double, it is considered to be pixels.
        Specified by:
        getCutout in interface IsDefaultOptions
        Returns:
        the portion of the chart that is cut out of the middle.
        As Double, it is considered to be pixels.
      • setCutoutPercentage

        public void setCutoutPercentage​(String cutout)
        Sets the portion of the chart that is cut out of the middle.
        As String and ending with '%', percentage of the chart radius.
        Parameters:
        cutout - the portion of the chart that is cut out of the middle.
        As String and ending with '%', percentage of the chart radius.
      • getCutoutPercentage

        public String getCutoutPercentage()
        Returns the portion of the chart that is cut out of the middle.
        As String and ending with '%', percentage of the chart radius.
        Specified by:
        getCutoutPercentage in interface IsDefaultOptions
        Returns:
        the portion of the chart that is cut out of the middle.
        As String and ending with '%', percentage of the chart radius.
      • setRadius

        public void setRadius​(double radius)
        Sets the outer radius of the chart.
        As Double, it is considered to be pixels.
        Parameters:
        radius - the outer radius of the chart.
        As Double, it is considered to be pixels.
      • getRadius

        public double getRadius()
        Returns the outer radius of the chart.
        As Double, it is considered to be pixels.
        Specified by:
        getRadius in interface IsDefaultOptions
        Returns:
        the outer radius of the chart.
        As Double, it is considered to be pixels.
      • setRadiusPercentage

        public void setRadiusPercentage​(String radius)
        Sets the outer radius of the chart.
        As String and ending with '%', percentage of the maximum radius.
        Parameters:
        radius - the outer radius of the chart.
        As String and ending with '%', percentage of the maximum radius.
      • getRadiusPercentage

        public String getRadiusPercentage()
        Returns the outer radius of the chart.
        As String and ending with '%', percentage of the maximum radius.
        Specified by:
        getRadiusPercentage in interface IsDefaultOptions
        Returns:
        the outer radius of the chart.
        As String and ending with '%', percentage of the maximum radius.
      • setRotation

        public void setRotation​(double rotation)
        Sets the starting angle to draw arcs from.
        Parameters:
        rotation - starting angle to draw arcs from.
      • getRotation

        public double getRotation()
        Returns the starting angle to draw arcs from.
        Specified by:
        getRotation in interface IsDefaultOptions
        Returns:
        starting angle to draw arcs from.
      • setCircumference

        public void setCircumference​(double circumference)
        Sets the sweep to allow arcs to cover.
        Parameters:
        circumference - the sweep to allow arcs to cover.
      • getCircumference

        public double getCircumference()
        Returns the sweep to allow arcs to cover.
        Specified by:
        getCircumference in interface IsDefaultOptions
        Returns:
        the sweep to allow arcs to cover.
      • setIndexAxis

        public void setIndexAxis​(IndexAxis indexAxis)
        Sets the base axis for the dataset. Use IndexAxis.Y for horizontal bar.
        Parameters:
        indexAxis - the base axis for the dataset
      • getIndexAxis

        public IndexAxis getIndexAxis()
        Returns the base axis for the dataset, only for bar options.
        Specified by:
        getIndexAxis in interface IsDefaultOptions
        Returns:
        the base axis for the dataset, only for bar options