Class HtmlLegendOptions


  • public final class HtmlLegendOptions
    extends AbstractPluginOptions
    Configuration options of HtmlLegend.ID plugin.
    This is mapping the configuration both default global and per chart instance.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_MAXIMUM_LEGEND_COLUMNS

        public static final int DEFAULT_MAXIMUM_LEGEND_COLUMNS
        Default maximum legends columns to show.
        See Also:
        Constant Field Values
      • DEFAULT_DISPLAY

        public static final boolean DEFAULT_DISPLAY
        Default display if legend must be showed.
        See Also:
        Constant Field Values
      • DEFAULT_CURSOR_POINTER

        public static final CursorType DEFAULT_CURSOR_POINTER
        Default cursor type when the cursor is over, CursorType.POINTER.
    • Constructor Detail

      • HtmlLegendOptions

        public HtmlLegendOptions()
        Builds the object with new java script object setting the default value of plugin.
        The global plugin options is used, if exists, as defaults values.
      • HtmlLegendOptions

        public HtmlLegendOptions​(IsChart chart)
        Builds the object with a chart instance in order to get the right defaults.
        If the plugin options have not been set by chart type, it will use the global.
        Parameters:
        chart - chart type to use to get the default values by chart
    • Method Detail

      • 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:
        true if the legend is shown.
      • getLegendItemCallback

        public HtmlLegendItemCallback getLegendItemCallback()
        Returns the callback which can be implemented to change the text of legend for a specific item, as HTML.
        Returns:
        the callback which can be implemented to change the text of legend for a specific item, as HTML
      • setLegendItemCallback

        public void setLegendItemCallback​(HtmlLegendItemCallback legendTextCallback)
        Sets the callback which can be implemented to change the text of legend for a specific item, as HTML.
        Parameters:
        legendTextCallback - the callback which can be implemented to change the text of legend for a specific item, as HTML
      • getLegendTitleCallback

        public HtmlLegendTitleCallback getLegendTitleCallback()
        Returns the callback which can be implemented to change the text of legend's title, as HTML.
        Returns:
        the callback which can be implemented to change the text of legend's title, as HTML
      • setLegendTitleCallback

        public void setLegendTitleCallback​(HtmlLegendTitleCallback legendTitleCallback)
        Sets the callback which can be implemented to change the text of legend's title, as HTML.
        Parameters:
        legendTitleCallback - the callback which can be implemented to change the text of legend's title, as HTML
      • setMaximumLegendColumns

        public void setMaximumLegendColumns​(int maxColumns)
        Sets the maximum amount of columns of legend.
        Parameters:
        maxColumns - the maximum amount of columns of legend
      • getMaximumLegendColumns

        public int getMaximumLegendColumns()
        Returns the maximum amount of columns of legend.
        Returns:
        he maximum amount of columns of legend
      • getLegendTextCallback

        public default HtmlLegendItemCallback getLegendTextCallback()
        Returns the callback which can be implemented to change the text of legend for a specific item, as HTML.
        Returns:
        the callback which can be implemented to change the text of legend for a specific item, as HTML
      • getCursorPointer

        public default CursorType getCursorPointer()
        Returns the cursor type when the cursor is over the dataset item.
        Returns:
        cursor type when the cursor is over the dataset item
      • setCursorPointer

        public final void setCursorPointer​(CursorType cursor)
        Sets the cursor type when the cursor is over the dataset item.
        Parameters:
        cursor - cursor type when the cursor is over the dataset item
      • getCursorPointer

        public final CursorType getCursorPointer()
        Returns the cursor type when the cursor is over the dataset item.
        Returns:
        cursor type when the cursor is over the dataset item