Class LegendNavigation

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware

    public class LegendNavigation
    extends Optionable
    Options for the paging or navigation appearing when the legend is overflown. When legend.useHTML is enabled, navigation is disabled.

    All the options in this class support DynamicalAttribute.

    Author:
    jumperchen, RaymondChao
    See Also:
    Serialized Form
    • Constructor Detail

      • LegendNavigation

        public LegendNavigation()
    • Method Detail

      • getActiveColor

        public Color getActiveColor()
        Returns the color for the active up or down arrow in the legend page navigation.

        Default: "#3E576F".

      • setActiveColor

        public void setActiveColor​(Color color)
        Sets the color for the active up or down arrow in the legend page navigation.
      • setActiveColor

        public void setActiveColor​(String color)
        Sets the color for the active up or down arrow in the legend page navigation.
      • setActiveColor

        public void setActiveColor​(LinearGradient color)
        Sets the color for the active up or down arrow in the legend page navigation.
      • setActiveColor

        public void setActiveColor​(RadialGradient color)
        Sets the color for the active up or down arrow in the legend page navigation.
      • isAnimation

        public boolean isAnimation()
        Returns whether to animate the pages when navigating up or down. A value of true applies the default navigation given in the chart.animation option. Additional options can be given as an object containing values for easing and duration. .

        Default: true.

      • getAnimation

        public Animation getAnimation()
        Returns whether to animate the pages when navigating up or down. A value of true applies the default navigation given in the chart.animation option

        Default: an instance of Animation

      • setAnimation

        public void setAnimation​(boolean animation)
        Sets whether to animate the pages when navigating up or down. A value of true applies the default navigation given in the chart.animation option. Additional options can be given as an object containing values for easing and duration.
        See Also:
        setAnimation(Animation), Animation
      • setAnimation

        public void setAnimation​(Animation animation)
        Sets whether to animate the pages when navigating up or down. A value of true applies the default navigation given in the chart.animation option. Additional options can be given as an object containing values for easing and duration.
        See Also:
        setAnimation(boolean), Animation
      • getArrowSize

        public Number getArrowSize()
        Returns the pixel size of the up and down arrows in the legend paging navigation.

        Default: 12.

      • setArrowSize

        public void setArrowSize​(Number arrowSize)
        Sets the pixel size of the up and down arrows in the legend paging navigation.
      • getIninactiveColor

        public Color getIninactiveColor()
        Returns the color of the inactive up or down arrow in the legend page navigation.

        Default: "#CCC".

      • setIninactiveColor

        public void setIninactiveColor​(Color color)
        Sets the color of the inactive up or down arrow in the legend page navigation.
      • setIninactiveColor

        public void setIninactiveColor​(String color)
        Sets the color of the inactive up or down arrow in the legend page navigation.
      • setIninactiveColor

        public void setIninactiveColor​(LinearGradient color)
        Sets the color of the inactive up or down arrow in the legend page navigation.
      • setIninactiveColor

        public void setIninactiveColor​(RadialGradient color)
        Sets the color of the inactive up or down arrow in the legend page navigation.
      • getStyle

        public <K,​V> Map<K,​V> getStyle()
        Returns the text styles for the legend page navigation.

        Default: null.

        Type Parameters:
        K - type for the key

        if style was set using setStyle(String), type will be String

        if style was set using setStyle(Map), type will be the same as the type from the key of the map

        if style was not set, type will be Object by default

        V - type for the value

        if style was set using setStyle(String), type will be String

        if style was set using setStyle(Map), type will be the same as the type from the key of the map

        if style was not set, type will be Object by default

      • setStyle

        public void setStyle​(String style)
        Sets the text styles for the legend page navigation.

        This method allows simple settings like

        
         label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");
         

        In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using setStyle(Map)

        Parameters:
        style - one or many CSS key:value pairs in a single line string format
      • setStyle

        public <K,​V> void setStyle​(Map<K,​V> style)
        Sets the text styles for the legend page navigation.

        This method allows complex styling like:

         
         Map<String, Object> styles = new HashMap<String, Object>();
         styles.put("fill", "#E8E8EA");
         styles.put("stroke", "#6E6E78");
         styles.put("stroke-width", "1");
         styles.put("r", "0");
         Map<String, Object> states = new HashMap<String, Object>();
         Map<String, String> hover = new HashMap<String, String>();
         hover.put("fill", "#F4F4F6");
         hover.put("stroke", "#6E6E78");
         hover.put("stroke-width", "1");
         hover.put("r", "0");
         states.put("hover", hover);
         styles.put("states", states);
         Map<String, String> style = new HashMap<String, String>();
         style.put("color", "#4D5663");
         style.put("fontSize", "12px");
         style.put("fontFamily", "'Arial'");
         style.put("fontWeight", "normal");
         style.put("padding", "10px");
         styles.put("style", style);
         
        which will generate the final results like:
        
         {
             "fill": "#E8E8EA",
             "stroke": "#6E6E78",
             "stroke-width": "1",
             "r": "0",
             "states":
             {
                 "hover":
                 {
                     "fill": "#F4F4F6",
                     "stroke": "#6E6E78",
                     "stroke-width": "1",
                     "r": "0"
                 }
             },
             "style":
             {
                 "color": "#4D5663",
                 "fontSize": "12px",
                 "fontFamily": "'Arial'",
                 "fontWeight": "normal",
                 "padding": "10px"
             }
         }
         
        Type Parameters:
        K - Type for the key, usually String
        V - Type for the value, usually String. For nested maps, use Object or any other type.
        Parameters:
        style - the style object