Class LegendLabelItem

  • All Implemented Interfaces:
    HasLegendText

    public final class LegendLabelItem
    extends LegendItem
    implements HasLegendText
    This object is created by callbacks and returned to CHART.JS as native object to configure the legend.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • LegendLabelItem

        public LegendLabelItem()
        Standard constructor which wraps a new native java script object.
    • Method Detail

      • setDatasetIndex

        public void setDatasetIndex​(int datasetIndex)
        Sets the data set index of the chart.
        Parameters:
        datasetIndex - the data set index of the chart
      • setIndex

        public void setIndex​(int index)
        Sets the data set index of the chart (for POLAR and PIE charts).
        Parameters:
        index - the data set index of the chart (for POLAR and PIE charts)
      • setFontColor

        public void setFontColor​(IsColor color)
        Sets the font color of the legend.
        Parameters:
        color - the font color of the legend
      • setFontColor

        public void setFontColor​(String color)
        Returns the font color of the legend.
        Parameters:
        color - the font color of the legend
      • setFillStyle

        public void setFillStyle​(IsColor color)
        Sets the fill style of the legend box as color.
        Parameters:
        color - the fill style of the legend box as color
      • setFillStyle

        public void setFillStyle​(String color)
        Sets the fill style of the legend box as color.
        Parameters:
        color - the fill style of the legend box as color
      • setFillStyle

        public void setFillStyle​(IsChart chart,
                                 Pattern pattern)
        Sets the fill style of the legend box as pattern.
        Parameters:
        chart - chart instance related to this legend
        pattern - the fill style of the legend box as pattern
      • setFillStyle

        public void setFillStyle​(IsChart chart,
                                 Gradient gradient)
        Sets the fill style of the legend box as gradient.
        Parameters:
        chart - chart instance related to this legend
        gradient - the fill style of the legend box as gradient
      • setLineCap

        public void setLineCap​(CapStyle style)
        Sets how the end points of every box border are drawn. There are three possible values for this property and those are: butt, round and square.
        Parameters:
        style - how the end points of every box border are drawn.
      • setLineDash

        public void setLineDash​(List<Integer> lineDash)
        Sets the box border dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Parameters:
        lineDash - the box border dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • setLineDashOffset

        public void setLineDashOffset​(double lineDashOffset)
        Sets the box border dash pattern offset.
        Parameters:
        lineDashOffset - the box border dash pattern offset.
      • setLineJoin

        public void setLineJoin​(JoinStyle style)
        Sets how two connecting segments (of box border) 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).
        There are three possible values for this property: round, bevel and miter.
        Parameters:
        style - There are three possible values for this property: round, bevel and miter.
      • setLineWidth

        public void setLineWidth​(int lineWidth)
        Sets the width of box border in pixels.
        Parameters:
        lineWidth - the width of box border in pixels.
      • setStrokeStyle

        public void setStrokeStyle​(IsColor color)
        Sets the stroke style of the legend box as color.
        Parameters:
        color - the stroke style of the legend box as color
      • setStrokeStyle

        public void setStrokeStyle​(String color)
        Sets the stroke style of the legend box as color.
        Parameters:
        color - the stroke style of the legend box as color
      • setStrokeStyle

        public void setStrokeStyle​(CanvasPatternItem pattern)
        Sets the stroke style of the legend box as canvas pattern.
        Parameters:
        pattern - the stroke style of the legend box as canvas pattern
      • setStrokeStyle

        public void setStrokeStyle​(IsChart chart,
                                   Pattern pattern)
        Sets the stroke style of the legend box as pattern.
        Parameters:
        chart - chart instance related to this legend
        pattern - the stroke style of the legend box as pattern
      • setStrokeStyle

        public void setStrokeStyle​(CanvasGradientItem gradient)
        Sets the stroke style of the legend box as canvas gradient.
        Parameters:
        gradient - the stroke style of the legend box as canvas gradient
      • setStrokeStyle

        public void setStrokeStyle​(IsChart chart,
                                   Gradient gradient)
        Sets the stroke style of the legend box as gradient.
        Parameters:
        chart - chart instance related to this legend
        gradient - the stroke style of the legend box as gradient
      • setPointStyle

        public void setPointStyle​(PointStyle style)
        Sets the style of the legend box (only used if usePointStyle is true)
        Parameters:
        style - the style of the legend box
      • setPointStyle

        public void setPointStyle​(Img pointStyle)
        Sets the style (as image) of the legend box (only used if usePointStyle is true)
        Parameters:
        pointStyle - the style (as image) of the legend box
      • setPointStyle

        public void setPointStyle​(Canvas pointStyle)
        Sets the style (as canvas) of the legend box (only used if usePointStyle is true)
        Parameters:
        pointStyle - the style (as canvas) of the legend box
      • setRotation

        public void setRotation​(double rotation)
        Sets the rotation of the point in degrees (only used if usePointStyle is true).
        Parameters:
        rotation - the rotation of the point in degrees