Class Loading

    • Constructor Detail

      • Loading

        public Loading()
    • Method Detail

      • setHideDuration

        public void setHideDuration​(Number hideDuration)
        Sets the duration in milliseconds of the fade out effect.

        Defaults to 100.

        Parameters:
        hideDuration -
      • getHideDuration

        public Number getHideDuration()
        Returns the duration in milliseconds of the fade out effect.

        Defaults to 100.

      • setLabelStyle

        public void setLabelStyle​(String labelStyle)
        Sets CSS styles for the loading label span.

        This method allows simple settings like

        
         loading.setLabelStyle("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 setLabelStyle(Map)

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

        public <K,​V> void setLabelStyle​(Map<K,​V> labelStyle)
        Sets CSS styles for the loading label span.

        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:
        labelStyle - the style object
      • getLabelStyle

        public <K,​V> Map<K,​V> getLabelStyle()
        Returns CSS styles for the loading label span. Defaults to
         fontWeight: 'bold'; position: 'relative'; top: '45%';
         
        Type Parameters:
        K - type for the key

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

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

        if style was not set, default style will be applied, and type will be String

        V - type for the value

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

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

        if style was not set, default style will be applied, and type will be String

      • setShowDuration

        public void setShowDuration​(Number showDuration)
        Sets the duration in milliseconds of the fade in effect.

        Defaults to 100.

        Parameters:
        showDuration -
      • getShowDuration

        public Number getShowDuration()
        Returns the duration in milliseconds of the fade in effect.

        Defaults to 100.

      • getStyle

        public <K,​V> Map<K,​V> getStyle()
        Returns CSS styles for the label. When labels are rotated they are rendered using vector graphic techniques and not all styles are applicable. Default:
         position: 'absolute'; backgroundColor: 'white'; opacity: 0.5; textAlign: 'center'
         

        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, default style will be applied, and type will be String

        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, default style will be applied, and type will be String

        Returns:
        style CSS styles for the label
      • setStyle

        public void setStyle​(String style)
        Sets CSS styles for the loading screen that covers the plot area.

        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 CSS styles for the loading screen that covers the plot area.

        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