Class WordCloudPlotOptions
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.plotOptions.SeriesPlotOptions
-
- org.zkoss.chart.plotOptions.ColumnPlotOptions
-
- org.zkoss.chart.plotOptions.WordCloudPlotOptions
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class WordCloudPlotOptions extends ColumnPlotOptions
An option for wordcloud plotAll the options in this class support
DynamicalAttribute
.- Since:
- 7.2.1.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description WordCloudPlotOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Number
getBorderWidth()
Returns the width of the border surrounding each column or bar.Number
getEdgeWidth()
3D columns only.Number
getMaxFontSize()
Returns the word with the largest weight will have a font size equal to this value.Number
getMinFontSize()
Returns a threshold determining the minimum font size that can be applied to a word.String
getPlacementStrategy()
Returns which algorithm is used for placement, and rotation of a word.WordCloudRotation
getRotation()
Returns the rotation options for the words in the wordcloud, if any.String
getSpiral()
Returns the spiral used for placing a word after the initial position experienced a collision with either another word or the borders.<K,V>
Map<K,V>getStyle()
Returns CSS styles for the words.void
setBorderWidth(Number borderWidth)
Sets the width of the border surrounding each column or bar.void
setEdgeWidth(Number edgeWidth)
3D columns only.void
setMaxFontSize(Number maxFontSize)
Sets the word with the largest weight will have a font size equal to this value.void
setMinFontSize(Number minFontSize)
Sets a threshold determining the minimum font size that can be applied to a word.void
setPlacementStrategy(String placementStrategy)
Sets which algorithm is used for placement, and rotation of a word.void
setRotation(WordCloudRotation rotation)
Sets the rotation options for the words in the wordcloud.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.void
setStyle(String style)
Sets CSS styles for the words.<K,V>
voidsetStyle(Map<K,V> style)
Sets CSS styles for the words.-
Methods inherited from class org.zkoss.chart.plotOptions.ColumnPlotOptions
getBorderColor, getBorderRadius, getColors, getCropThreshold, getEdgeColor, getGroupPadding, getGroupZPadding, getMaxPointWidth, getMinPointLength, getPointPadding, getPointRange, getPointWidth, isCenterInCategory, isCrisp, isGrouping, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setCenterInCategory, setColors, setColors, setCrisp, setCropThreshold, setEdgeColor, setEdgeColor, setGrouping, setGroupPadding, setGroupZPadding, setMaxPointWidth, setMinPointLength, setPointPadding, setPointRange, setPointWidth
-
Methods inherited from class org.zkoss.chart.plotOptions.SeriesPlotOptions
addDataLabels, getAccessibility, getAnimation, getAnimationLimit, getBoostBlending, getBoostThreshold, getClassName, getColor, getColorAxis, getColorIndex, getColorKey, getConnectorWidth, getCursor, getCustom, getDashStyle, getDataLabels, getDataLabelsList, getDataSorting, getDepth, getDescription, getDragDrop, getFindNearestPointBy, getId, getIndex, getKeys, getLabel, getLegendSymbol, getLinecap, getLineWidth, getLinkedTo, getMarker, getName, getNeckHeight, getNeckWidth, getNegativeColor, getOnPoint, getOpacity, getPointDescriptionFormatter, getPointInterval, getPointIntervalUnit, getPointPlacement, getPointStart, getStacking, getStates, getStep, getThreshold, getTooltip, getTurboThreshold, getZoneAxis, getZones, isAllowPointSelect, isAnimation, isClip, isColorByPoint, isConnectEnds, isConnectNulls, isDataAsColumns, isEnableMouseTracking, isGetExtremesFromAll, isIncludeInDataExport, isRelativeXValue, isSelected, isShadow, isShowCheckbox, isShowInLegend, isSkipKeyboardNavigation, isSoftThreshold, isStacking, isStickyTracking, isVisible, newDataLabels, setAccessibility, setAllowPointSelect, setAnimation, setAnimation, setAnimationLimit, setBoostBlending, setBoostThreshold, setBorderRadius, setBorderRadius, setCenter, setCenter, setClassName, setClip, setColor, setColor, setColor, setColor, setColorAxis, setColorAxis, setColorAxis, setColorByPoint, setColorIndex, setColorKey, setConnectEnds, setConnectNulls, setConnectorWidth, setCursor, setCustom, setDashStyle, setDataAsColumns, setDataLabels, setDataLabels, setDataSorting, setDepth, setDescription, setDragDrop, setEnableMouseTracking, setFindNearestPointBy, setGetExtremesFromAll, setId, setIncludeInDataExport, setIndex, setKeys, setLabel, setLegendSymbol, setLinecap, setLineWidth, setLinkedTo, setMarker, setName, setNeckHeight, setNeckWidth, setNegativeColor, setNegativeColor, setNegativeColor, setNegativeColor, setOnPoint, setOpacity, setPointDescriptionFormatter, setPointInterval, setPointIntervalUnit, setPointPlacement, setPointPlacement, setPointStart, setRelativeXValue, setSelected, setShadow, setShowCheckbox, setShowInLegend, setSkipKeyboardNavigation, setSoftThreshold, setStacking, setStacking, setStates, setStep, setStickyTracking, setThreshold, setTooltip, setTurboThreshold, setVisible, setWidth, setZoneAxis, setZones, setZones
-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.zkoss.chart.OptionDataListener
onChange
-
-
-
-
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 classColumnPlotOptions
- 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 classColumnPlotOptions
- Since:
- 10.2.1.0
-
getEdgeWidth
public Number getEdgeWidth()
3D columns only. Returns the width of the colored edges.Default: 1
- Overrides:
getEdgeWidth
in classColumnPlotOptions
- Since:
- 10.2.1.0
-
setEdgeWidth
public void setEdgeWidth(Number edgeWidth)
3D columns only. Sets the width of the colored edges.- Overrides:
setEdgeWidth
in classColumnPlotOptions
- 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 keyif style was set using
setStyle(String)
, type will be Stringif style was set using
setStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
V
- type for the valueif style was set using
setStyle(String)
, type will be Stringif style was set using
setStyle(Map)
, type will be the same as the type from the key of the mapif 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);
{ "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 StringV
- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
style
- the style object
-
-