Class Credits
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Credits
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class Credits extends Optionable
A credits option to put a credits label in the lower right corner of the chart. This can be changed using these options.All the options in this class support
DynamicalAttribute.- 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 Credits()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.zkoss.json.JavaScriptValuegetEvents()Returns the event handlers for the credits label.StringgetHref()Returns the URL for the credits label.PositiongetPosition()Returns position configuration for the credtis label.<K,V>
Map<K,V>getStyle()Returns the CSS styles for the credits label.StringgetText()Returns the text for the credits label.booleanisEnabled()Returns whether to show the credits text.booleanisUseHTML()Returns whether to render the credits as HTML.voidsetEnabled(boolean enabled)Sets whether to show the credits text.voidsetEvents(org.zkoss.json.JavaScriptValue events)Sets the event handlers for the credits label, for examplenew JavaScriptValue("{click: function (event) {...}}").voidsetHref(String href)Sets the URL for the credits label.voidsetPosition(Position position)Sets position configuration for the credtis label.voidsetStyle(String style)Sets the CSS styles for the credits label.<K,V>
voidsetStyle(Map<K,V> style)Sets the CSS styles for the credits label.voidsetText(String text)Sets the text for the credits label.voidsetUseHTML(boolean useHTML)Sets whether to render the credits as HTML.-
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
-
isEnabled
public boolean isEnabled()
Returns whether to show the credits text.Default: false
-
setEnabled
public void setEnabled(boolean enabled)
Sets whether to show the credits text.
-
getEvents
public org.zkoss.json.JavaScriptValue getEvents()
Returns the event handlers for the credits label.Default: null
- Since:
- 13.1.1.0
-
setEvents
public void setEvents(org.zkoss.json.JavaScriptValue events)
Sets the event handlers for the credits label, for examplenew JavaScriptValue("{click: function (event) {...}}"). The click handler can callevent.preventDefault()to prevent the default navigation.- Since:
- 13.1.1.0
-
getHref
public String getHref()
Returns the URL for the credits label.Default: "https://www.highcharts.com"
-
setHref
public void setHref(String href)
Sets the URL for the credits label.
-
getPosition
public Position getPosition()
Returns position configuration for the credtis label. Supported properties arealign,verticalAlign,xandy. Defaults toposition: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 }
-
setPosition
public void setPosition(Position position)
Sets position configuration for the credtis label. Supported properties arealign,verticalAlign,xandy. Defaults toposition: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 }
-
getStyle
public <K,V> Map<K,V> getStyle()
Returns the CSS styles for the credits label. Defaults to:cursor: pointer; color: #909090; fontSize: 10px;
- 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 the CSS styles for the credits label. Defaults to: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 CSS styles for the credits label. Defaults to:This method allows complex styling like:
which will generate the final results 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
-
getText
public String getText()
Returns the text for the credits label.Default: "Highcharts.com"
-
setText
public void setText(String text)
Sets the text for the credits label.
-
isUseHTML
public boolean isUseHTML()
Returns whether to render the credits as HTML.Default: false
- Since:
- 13.1.1.0
-
setUseHTML
public void setUseHTML(boolean useHTML)
Sets whether to render the credits as HTML.- Since:
- 13.1.1.0
-
-