Package org.zkoss.chart
Class DrillUpButton
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.DrillUpButton
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class DrillUpButton extends Optionable
Options for the drill up button that appears when drilling down on a series. The text for the button is defined inLang.getDrillUpText()
.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description DrillUpButton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
getPosition()
Returns positioning options for the button within therelativeTo
box.String
getRelativeTo()
Returns what box to align the button to.<K,V>
Map<K,V>getTheme()
Returns a collection of attributes for the button.void
setPosition(Position position)
Sets positioning options for the button within therelativeTo
box.void
setRelativeTo(String relativeTo)
Sets what box to align the button to.<K,V>
voidsetTheme(Map<K,V> theme)
Sets a collection of attributes for the button.-
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
-
-
-
-
Method Detail
-
getPosition
public Position getPosition()
Returns positioning options for the button within therelativeTo
box. Available properties arex
,y
,align
andverticalAlign
.Default: null
-
setPosition
public void setPosition(Position position)
Sets positioning options for the button within therelativeTo
box. Available properties arex
,y
,align
andverticalAlign
.
-
getRelativeTo
public String getRelativeTo()
Returns what box to align the button to. Can be either "plotBox" or "spacingBox".Default:
plotBox
-
setRelativeTo
public void setRelativeTo(String relativeTo)
Sets what box to align the button to. Can be either "plotBox" or "spacingBox".Default:
plotBox
-
getTheme
public <K,V> Map<K,V> getTheme()
Returns a collection of attributes for the button. The object takes SVG attributes likefill
,stroke
,stroke-width
orr
, the border radius. The theme also supportsstyle
, a collection of CSS properties for the text. Equivalent attributes for the hover state are given intheme.states.hover
.- Type Parameters:
K
- type for the keyif style was set using
setTheme(Map)
, type will be the same as the type from the key of the mapif style was not set, type will be Object by default
V
- type for the valueif style was set using
setTheme(Map)
, type will be the same as the type from the key of the mapif style was not set, type will be Object by default
-
setTheme
public <K,V> void setTheme(Map<K,V> theme)
Sets a collection of attributes for the button. The object takes SVG attributes likefill
,stroke
,stroke-width
orr
, the border radius. The theme also supportsstyle
, a collection of CSS properties for the text. Equivalent attributes for the hover state are given intheme.states.hover
.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:
theme
- the theme object
-
-