Class DatasetElementOptions


  • public final class DatasetElementOptions
    extends NativeObjectContainer
    This item provides all information about the view where a dataset has been displayed.
    This object has been created and passed to event handler or callbacks to apply own logic.
    This is a wrapper of the CHART.JS item with all needed info.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • isBackgroundColorAsColor

        public boolean isBackgroundColorAsColor()
        Returns true if the background color is defined as color.
        Returns:
        true if the background color is defined as color
      • isBackgroundColorAsGradient

        public boolean isBackgroundColorAsGradient()
        Returns true if the background color is defined as gradient.
        Returns:
        true if the background color is defined as gradient
      • isBackgroundColorAsPattern

        public boolean isBackgroundColorAsPattern()
        Returns true if the background color is defined as canvas pattern.
        Returns:
        true if the background color is defined as canvas pattern
      • getBackgroundColorAsString

        public String getBackgroundColorAsString()
        Returns the background color of the dataset item.
        Returns:
        the background color of the dataset item.
      • getBackgroundColor

        public IsColor getBackgroundColor()
        Returns the background color of the dataset item.
        Returns:
        the background color of the dataset item.
      • getBackgroundColorAsGradient

        public Gradient getBackgroundColorAsGradient()
        Returns the background color as gradient.
        Returns:
        the background color or null if is not a gradient
      • getBackgroundColorAsCanvasGradient

        public CanvasGradientItem getBackgroundColorAsCanvasGradient()
        Returns the background color as canvas gradient.
        Returns:
        the background color or null if is not a canvas gradient
      • getBackgroundColorAsPattern

        public Pattern getBackgroundColorAsPattern()
        Returns the background color as pattern.
        Returns:
        the background color or null if is not a pattern
      • getBackgroundColorAsCanvasPattern

        public CanvasPatternItem getBackgroundColorAsCanvasPattern()
        Returns the background color as canvas pattern.
        Returns:
        the background color or null if is not a canvas pattern
      • 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.
        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.
      • isBorderColorAsColor

        public boolean isBorderColorAsColor()
        Returns true if the border color is defined as color.
        Returns:
        true if the border color is defined as color
      • isBorderColorAsGradient

        public boolean isBorderColorAsGradient()
        Returns true if the border color is defined as gradient.
        Returns:
        true if the border color is defined as gradient
      • getBorderColorAsString

        public String getBorderColorAsString()
        Returns the color of the dataset item border
        Returns:
        the color of the dataset item border.
      • getBorderColor

        public IsColor getBorderColor()
        Returns the color of the dataset item border
        Returns:
        the color of the dataset item border
      • getBorderColorAsGradient

        public Gradient getBorderColorAsGradient()
        Returns the border color as gradient.
        Returns:
        the border color or null if is not a gradient
      • getBorderColorAsCanvasGradient

        public CanvasGradientItem getBorderColorAsCanvasGradient()
        Returns the border color as canvas gradient.
        Returns:
        the border color or null if is not a canvas gradient
      • 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.
      • 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.
      • getBorderAlign

        public BorderAlign getBorderAlign()
        Returns the property to set the border alignment on chart datasets.
        Returns:
        the property to set the border alignment on chart datasets.
      • getWeight

        public double getWeight()
        Returns the relative thickness of the dataset.
        Returns:
        the relative thickness of the dataset
      • getAngle

        public double getAngle()
        Returns the arc angle to cover.
        Returns:
        the arc angle to cover
      • getOffset

        public int getOffset()
        Returns the arc offset (in pixels).
        Returns:
        the arc offset
      • getBorderSkipped

        public BorderSkipped getBorderSkipped()
        Returns the edge to skip drawing the border for.
        Returns:
        the edge to skip drawing the border for.
      • 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).
      • getTension

        public double getTension()
        Returns the Bézier curve tension (0 for no Bézier curves).
        Returns:
        the Bézier curve tension (0 for no Bézier curves).
      • getBorderCapStyle

        public CapStyle getBorderCapStyle()
        Returns how the end points of every line are drawn.
        Returns:
        how the end points of every line are drawn.
      • getBorderDash

        public List<Integer> getBorderDash()
        Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Returns:
        the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • getBorderDashOffset

        public double getBorderDashOffset()
        Returns the line dash pattern offset.
        Returns:
        the line dash pattern offset.
      • getBorderJoinStyle

        public JoinStyle getBorderJoinStyle()
        Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
        Returns:
        how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
      • isCapBezierPoints

        public boolean isCapBezierPoints()
        Returns true to keep Bézier control inside the chart, false for no restriction.
        Returns:
        true to keep Bézier control inside the chart, false for no restriction.
      • getCubicInterpolationMode

        public CubicInterpolationMode getCubicInterpolationMode()
        Returns algorithm used to interpolate a smooth curve from the discrete data points.
        Returns:
        algorithm used to interpolate a smooth curve from the discrete data points.
      • isStepped

        public Stepped isStepped()
        Returns if the line is shown as a stepped line.
        Returns:
        If the line is shown as a stepped line.
      • getFill

        public IsFill getFill()
        Returns how to fill the area under the line.
        Returns:
        how to fill the area under the line.
      • getRadius

        public double getRadius()
        Returns the radius of the point.
        Returns:
        the radius of the point
      • getHitRadius

        public double getHitRadius()
        Returns the pixel size of the non-displayed point that reacts to mouse events.
        Returns:
        the pixel size of the non-displayed point.
      • getHoverRadius

        public double getHoverRadius()
        Returns the radius of the point when hovered.
        Returns:
        the radius of the point when hovered.
      • getHoverBorderWidth

        public int getHoverBorderWidth()
        Returns the border width of point when hovered.
        Returns:
        the border width of point when hovered.
      • getRotation

        public double getRotation()
        Returns the point rotation (in degrees).
        Returns:
        the point rotation (in degrees).
      • getPointStyleType

        public PointStyleType getPointStyleType()
        Returns the type of point style.
        Returns:
        the type of point style
      • getPointStyleAsImage

        public Img getPointStyleAsImage()
        Returns the style of the point as image.
        If property is missing or not an image, returns null.
        Returns:
        image of the style of the point as image.
        If property is missing or not a image, returns null.
      • getPointStyleAsCanvas

        public Canvas getPointStyleAsCanvas()
        Returns the style of the point as canvas.
        If property is missing or not an canvas, returns null.
        Returns:
        canvas of the style of the point as canvas.
        If property is missing or not a canvas, returns null.
      • getPointStyle

        public PointStyle getPointStyle()
        Returns the style of the point.
        Returns:
        the style of the point
      • createTooltipLabelColor

        public TooltipLabelColor createTooltipLabelColor()
        Create new TooltipLabelColor filling it with background and border color of dataset element.
        Returns:
        new TooltipLabelColor filling it with background and border color of dataset element