Class HtmlLegendOptionsBuilder

  • All Implemented Interfaces:
    IsBuilder

    public final class HtmlLegendOptionsBuilder
    extends AbstractBaseBuilder
    Comfortable object to create HtmlLegend.ID plugin options by a builder.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • create

        public static HtmlLegendOptionsBuilder create()
        Returns new builder instance, using the global options as default.
        Returns:
        new builder instance
      • create

        public static HtmlLegendOptionsBuilder create​(IsChart chart)
        Returns new builder instance using chart global options as default.
        Parameters:
        chart - chart instance related to the plugin options
        Returns:
        new builder instance
      • build

        public HtmlLegendOptions build()
        Returns a configured plugin options.
        Returns:
        a configured plugin options.
      • setDisplay

        public HtmlLegendOptionsBuilder setDisplay​(boolean display)
        Sets if the legend is shown.
        Parameters:
        display - if the legend is shown.
        Returns:
        new builder instance
      • setLegendItemCallback

        public HtmlLegendOptionsBuilder 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
        Returns:
        new builder instance
      • setLegendTitleCallback

        public HtmlLegendOptionsBuilder 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
        Returns:
        new builder instance
      • setMaximumLegendColumns

        public HtmlLegendOptionsBuilder setMaximumLegendColumns​(int maxColumns)
        Sets the maximum amount of columns of legend.
        Parameters:
        maxColumns - the maximum amount of columns of legend
        Returns:
        new builder instance