Class Legend

    • Method Detail

      • getLabels

        public LegendLabels getLabels()
        Returns the legend labels element.
        Returns:
        the labels
      • getTitle

        public LegendTitle getTitle()
        Returns the legend title element.
        Returns:
        the title
      • setEvents

        public void setEvents​(IsEvent... events)
        Sets the browser events that the legend should listen to.
        Parameters:
        events - the browser events that the legend should listen to.
      • setEvents

        public void setEvents​(Set<IsEvent> events)
        Sets the browser events that the legend should listen to.
        Parameters:
        events - the browser events that the legend should listen to.
      • getEvents

        public Set<IsEvent> getEvents()
        Returns the browser events that the legend should listen to.
        Returns:
        the browser events that the legend should listen to.
      • hasClickHandlers

        public final boolean hasClickHandlers()
        Returns true if there is any legend click handler, otherwise false.
        Returns:
        true if there is any legend click handler, otherwise false.
      • hasHoverHandlers

        public final boolean hasHoverHandlers()
        Returns true if there is any legend hover handler, otherwise false.
        Returns:
        true if there is any legend hover handler, otherwise false.
      • hasLeaveHandlers

        public final boolean hasLeaveHandlers()
        Returns true if there is any legend leave handler, otherwise false.
        Returns:
        true if there is any legend leave handler, otherwise false.
      • setDisplay

        public void setDisplay​(boolean display)
        Sets if the legend is shown.
        Parameters:
        display - if the legend is shown.
      • isDisplay

        public boolean isDisplay()
        Returns if the legend is shown.
        Returns:
        if the legend is shown.
      • setFullSize

        public void setFullSize​(boolean fullSize)
        Marks that this box should take the full width/height of the canvas (moving other boxes).
        Parameters:
        fullSize - Marks that this box should take the full width/height of the canvas (moving other boxes)
      • isFullSize

        public boolean isFullSize()
        Returns if marks that this box should take the full width/height of the canvas (moving other boxes).
        Returns:
        Marks that this box should take the full width/height of the canvas (moving other boxes)
      • setReverse

        public void setReverse​(boolean reverse)
        Sets the legend will show datasets in reverse order.
        Parameters:
        reverse - legend will show datasets in reverse order.
      • isReverse

        public boolean isReverse()
        Returns if the legend will show datasets in reverse order.
        Returns:
        Legend will show datasets in reverse order.
      • setPosition

        public void setPosition​(Position position)
        Sets the position of the legend.
        Parameters:
        position - Position of the legend.
      • getPosition

        public Position getPosition()
        Returns the position of the legend.
        Returns:
        Position of the legend.
      • setAlign

        public void setAlign​(ElementAlign alignment)
        Sets the alignment of the legend.
        Parameters:
        alignment - alignment of the legend.
      • getAlign

        public ElementAlign getAlign()
        Returns the alignment of the legend.
        Returns:
        alignment of the legend.
      • setRtl

        public void setRtl​(boolean rtl)
        Sets true for rendering the legends from right to left.
        Parameters:
        rtl - true for rendering the legends from right to left
      • isRtl

        public boolean isRtl()
        Returns true for rendering the legends from right to left.
        Returns:
        true for rendering the legends from right to left.
      • setTextDirection

        public void setTextDirection​(TextDirection textDirection)
        Sets the text direction of the legend that will force the text direction on the canvas for rendering the legend, regardless of the CSS specified on the canvas.
        Parameters:
        textDirection - the text direction of the legend.
      • getTextDirection

        public TextDirection getTextDirection()
        Returns the text direction of the legend that will force the text direction on the canvas for rendering the legend, regardless of the CSS specified on the canvas.
        Returns:
        the text direction of the legend.
      • setMaxWidth

        public void setMaxWidth​(int maxWidth)
        Sets the maximum width of the legend, in pixels.
        Parameters:
        maxWidth - the maximum width of the legend, in pixels
      • getMaxWidth

        public int getMaxWidth()
        Returns the maximum width of the legend, in pixels.
        Returns:
        the maximum width of the legend, in pixels
      • setMaxHeight

        public void setMaxHeight​(int maxHeight)
        Sets the maximum height of the legend, in pixels.
        Parameters:
        maxHeight - the maximum height of the legend, in pixels
      • getMaxHeight

        public int getMaxHeight()
        Returns the maximum width of the legend, in pixels.
        Returns:
        the maximum width of the legend, in pixels
      • getOptions

        protected final ConfigurationOptions getOptions()
        Returns the configuration options.
        Returns:
        the configuration options.
      • getConfiguration

        protected final ExtendedOptions getConfiguration()
        Returns the configuration element.
        Returns:
        the configuration element.
      • getChart

        public final IsChart getChart()
        Returns the chart instance
        Returns:
        the chart