Class BarElementOptions

  • Direct Known Subclasses:
    GeoFeatureElementOptions

    public class BarElementOptions
    extends CommonElementOptions
    Maps the out-of-the-box CHART.JS element options used to represents bars on the charts.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • BarElementOptions

        protected BarElementOptions​(NativeObject nativeObject)
        Creates the item using a native java script object which contains all properties.
        Parameters:
        nativeObject - native java script object which contains all properties.
    • Method Detail

      • getDefaultBorderWidth

        protected int getDefaultBorderWidth()
        Description copied from class: CommonElementOptions
        This method must be overrided by all element where the border width is stored in different object.
        Overrides:
        getDefaultBorderWidth in class CommonElementOptions
        Returns:
        an undefined integer
      • isBorderWidthAsObject

        public boolean isBorderWidthAsObject()
        Returns true if the border width is defined as BarBorderWidth.
        Returns:
        true if the border width is defined as BarBorderWidth
      • getBorderWidth

        public int getBorderWidth()
        Returns the border width of the dataset item in pixels.
        Overrides:
        getBorderWidth in class CommonElementOptions
        Returns:
        the border width of the dataset item in pixels.
      • getBorderWidthAsObject

        public BarBorderWidth getBorderWidthAsObject()
        Returns the border width of the dataset item in pixels as BarBorderWidth.
        Returns:
        the border width of the dataset item in pixels as BarBorderWidth.
      • setBorderWidth

        public void setBorderWidth​(BarBorderWidth borderWidth)
        Sets the border width.
        Parameters:
        borderWidth - the border width.
      • getBarPercentage

        public double getBarPercentage()
        Returns the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
        Returns:
        percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
      • setBarPercentage

        public void setBarPercentage​(double barPercentage)
        Sets the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
        Parameters:
        barPercentage - percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
      • getCategoryPercentage

        public double getCategoryPercentage()
        Returns the percent (0-1) of the available width each category should be within the sample width.
        Returns:
        the percent (0-1) of the available width each category should be within the sample width.
      • setCategoryPercentage

        public void setCategoryPercentage​(double categoryPercentage)
        Sets the percent (0-1) of the available width each category should be within the sample width.
        Parameters:
        categoryPercentage - percent (0-1) of the available width each category should be within the sample width.
      • getBase

        public double getBase()
        Returns the base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value.
        Returns:
        base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value
      • setBase

        public void setBase​(double base)
        Sets the base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value.
        Parameters:
        base - base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value
      • getBorderSkipped

        public BorderSkipped getBorderSkipped()
        Returns the edge to skip drawing the border for.
        Returns:
        the edge to skip drawing the border for.
      • setBorderSkipped

        public void setBorderSkipped​(BorderSkipped position)
        Sets the edge to skip drawing the border for.
        Parameters:
        position - the edge to skip drawing the border for.
      • setBorderSkipped

        public void setBorderSkipped​(boolean borderskip)
        Sets the edge to skip drawing the border for.
        Parameters:
        borderskip - to set false as border skipped.
      • isBorderRadiusAsObject

        public boolean isBorderRadiusAsObject()
        Returns true if the border width is defined as BarBorderRadius.
        Returns:
        true if the border width is defined as BarBorderRadius
      • getBorderRadius

        public int getBorderRadius()
        Returns the bar border radius (in pixels).
        Returns:
        the bar border radius (in pixels).
      • setBorderRadius

        public void setBorderRadius​(int borderRadius)
        Sets the bar border radius (in pixels).
        Parameters:
        borderRadius - the bar border radius (in pixels).
      • setBorderRadius

        public void setBorderRadius​(BarBorderRadius borderRadius)
        Sets the bar border radius (in pixels).
        Parameters:
        borderRadius - the bar border radius (in pixels).
      • isAutoInflateAmount

        public boolean isAutoInflateAmount()
        Returns true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.
        Returns:
        true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
      • setAutoInflateAmount

        public void setAutoInflateAmount​(boolean autoInflateAmount)
        Sets true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.
        Parameters:
        autoInflateAmount - true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
      • getInflateAmount

        public int getInflateAmount()
        Returns the amount of pixels to inflate the bar rectangles, when drawing.
        Returns:
        the amount of pixels to inflate the bar rectangles, when drawing
      • setInflateAmount

        public void setInflateAmount​(int inflateAmount)
        Sets the amount of pixels to inflate the bar rectangles, when drawing.
        Parameters:
        inflateAmount - the amount of pixels to inflate the bar rectangles, when drawing