Class WordCloudPlotOptions

    • Constructor Detail

      • WordCloudPlotOptions

        public WordCloudPlotOptions()
    • Method Detail

      • getBorderWidth

        public Number getBorderWidth()
        Returns the width of the border surrounding each column or bar.

        Default: 0 when the columns are so dense that a border would cover the next column.

        Overrides:
        getBorderWidth in class ColumnPlotOptions
        Since:
        10.2.1.0
      • setBorderWidth

        public void setBorderWidth​(Number borderWidth)
        Sets the width of the border surrounding each column or bar.
        Overrides:
        setBorderWidth in class ColumnPlotOptions
        Since:
        10.2.1.0
      • getEdgeWidth

        public Number getEdgeWidth()
        3D columns only. Returns the width of the colored edges.

        Default: 1

        Overrides:
        getEdgeWidth in class ColumnPlotOptions
        Since:
        10.2.1.0
      • setEdgeWidth

        public void setEdgeWidth​(Number edgeWidth)
        3D columns only. Sets the width of the colored edges.
        Overrides:
        setEdgeWidth in class ColumnPlotOptions
        Since:
        10.2.1.0
      • getMaxFontSize

        public Number getMaxFontSize()
        Returns the word with the largest weight will have a font size equal to this value. The font size of a word is the ratio between its weight and the largest occurring weight, multiplied with the value of maxFontSize.

        Default: 25

      • setMaxFontSize

        public void setMaxFontSize​(Number maxFontSize)
        Sets the word with the largest weight will have a font size equal to this value. The font size of a word is the ratio between its weight and the largest occurring weight, multiplied with the value of maxFontSize.
      • getMinFontSize

        public Number getMinFontSize()
        Returns a threshold determining the minimum font size that can be applied to a word.

        Default: 1

      • setMinFontSize

        public void setMinFontSize​(Number minFontSize)
        Sets a threshold determining the minimum font size that can be applied to a word.
      • getPlacementStrategy

        public String getPlacementStrategy()
        Returns which algorithm is used for placement, and rotation of a word. The choice of algorithm is therefore a crucial part of the resulting layout of the wordcloud. It is possible for users to add their own custom placement strategies for use in word cloud. Read more about it in documentation.

        Default: "center"

      • setPlacementStrategy

        public void setPlacementStrategy​(String placementStrategy)
        Sets which algorithm is used for placement, and rotation of a word. The choice of algorithm is therefore a crucial part of the resulting layout of the wordcloud. It is possible for users to add their own custom placement strategies for use in word cloud. Read more about it in documentation.
      • getRotation

        public WordCloudRotation getRotation()
        Returns the rotation options for the words in the wordcloud, if any. Otherwise, create a new one.
      • setRotation

        public void setRotation​(WordCloudRotation rotation)
        Sets the rotation options for the words in the wordcloud.
      • getSpiral

        public String getSpiral()
        Returns the spiral used for placing a word after the initial position experienced a collision with either another word or the borders. It is possible for users to add their own custom spiralling algorithms for use in word cloud. Read more about it in documentation.

        Default: "rectangular"

      • setSpiral

        public void setSpiral​(String spiral)
        Sets the spiral used for placing a word after the initial position experienced a collision with either another word or the borders. It is possible for users to add their own custom spiralling algorithms for use in word cloud. Read more about it in documentation.
      • getStyle

        public <K,​V> Map<K,​V> getStyle()
        Returns CSS styles for the words.

        Default: "fontFamily: 'sans-serif'; fontWeight: 900"

        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

      • setStyle

        public void setStyle​(String style)
        Sets CSS styles for the words.

        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 words.

        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