Class TooltipPlotOptions
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.plotOptions.TooltipPlotOptions
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class TooltipPlotOptions extends Optionable
An option for tooltip plotAll the options in this class support
DynamicalAttribute.- Author:
- RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description TooltipPlotOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeLabelFormatsgetDateTimeLabelFormats()Returns the date format in the tooltip's headerStringgetFooterFormat()Returns a string to append to the tooltip format.StringgetFormat()Returns a format text of the tooltip.StringgetHeaderFormat()Returns the HTML of the tooltip header line.NumbergetHideDelay()Returns the number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.StringgetPointFormat()Returns the HTML of the point's line in the tooltip.NumbergetValueDecimals()Returns how many decimals to show in each series' y value.StringgetValuePrefix()Returns a string to prepend to each series' y value.StringgetValueSuffix()Returns a string to append to each series' y value.StringgetXDateFormat()Returns the format for the date in the tooltip header if the X axis is a datetime axis.booleanisFollowPointer()Returns whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an extent.booleanisFollowTouchMove()Returns whether the tooltip should follow the finger as it moves on a touch device.voidsetDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)Sets the date format in the tooltip's headervoidsetFollowPointer(boolean followPointer)Sets whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an extent.voidsetFollowTouchMove(boolean followTouchMove)Sets whether the tooltip should follow the finger as it moves on a touch device.voidsetFooterFormat(String footerFormat)Sets a string to append to the tooltip format.voidsetFormat(String format)Sets a format text of the tooltip.voidsetHeaderFormat(String headerFormat)Sets the HTML of the tooltip header line.voidsetHideDelay(Number hideDelay)Sets the number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.voidsetPointFormat(String pointFormat)Sets the HTML of the point's line in the tooltip.voidsetValueDecimals(Number valueDecimals)Sets how many decimals to show in each series' y value.voidsetValuePrefix(String valuePrefix)Sets a string to prepend to each series' y value.voidsetValueSuffix(String valueSuffix)Sets the string to append to each series' y value.voidsetXDateFormat(String xDateFormat)Sets the format for the date in the tooltip header if the X axis is a datetime axis.-
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
-
getDateTimeLabelFormats
public DateTimeLabelFormats getDateTimeLabelFormats()
Returns the date format in the tooltip's headerFor series on a datetime axes, the date format in the tooltip's header will by default be guessed based on the closest data points. This member gives the default string representations used for each unit. For an overview of the replacement codes, see
Charts.setDateFormat(String, Number, boolean).Defaults:
{ millisecond:"%A, %b %e, %H:%M:%S.%L", second:"%A, %b %e, %H:%M:%S", minute:"%A, %b %e, %H:%M", hour:"%A, %b %e, %H:%M", day:"%A, %b %e, %Y", week:"Week from %A, %b %e, %Y", month:"%B %Y", year:"%Y" }- Returns:
- dateTimeLabelFormats the date format in the tooltip's header
-
setDateTimeLabelFormats
public void setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
Sets the date format in the tooltip's headerFor series on a datetime axes, the date format in the tooltip's header will by default be guessed based on the closest data points. This member gives the default string representations used for each unit. For an overview of the replacement codes, see
Charts.setDateFormat(String, Number, boolean).- Parameters:
dateTimeLabelFormats- the date format in the tooltip's header
-
isFollowPointer
public boolean isFollowPointer()
Returns whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an extent. By default it behaves this way for scatter, bubble and pie series by override in theplotOptionsfor those series types.For touch moves to behave the same way,
setFollowTouchMove(boolean)must betruealso.Default: false.
-
setFollowPointer
public void setFollowPointer(boolean followPointer)
Sets whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an extent. By default it behaves this way for scatter, bubble and pie series by override in theplotOptionsfor those series types.For touch moves to behave the same way,
setFollowTouchMove(boolean)must betruealso.
-
isFollowTouchMove
public boolean isFollowTouchMove()
Returns whether the tooltip should follow the finger as it moves on a touch device. The default value offalsecauses a touch move to scroll the web page, as is default behaviour on touch devices. Setting it totruemay cause the user to be trapped inside the chart and unable to scroll away, so it should be used with care. IfChart.setZoomType(String)is set, it will overridesetFollowTouchMove(boolean).Default: false.
-
setFollowTouchMove
public void setFollowTouchMove(boolean followTouchMove)
Sets whether the tooltip should follow the finger as it moves on a touch device. The default value offalsecauses a touch move to scroll the web page, as is default behaviour on touch devices. Setting it totruemay cause the user to be trapped inside the chart and unable to scroll away, so it should be used with care. IfChart.setZoomType(String)is set, it will overridesetFollowTouchMove(boolean).
-
getFooterFormat
public String getFooterFormat()
Returns a string to append to the tooltip format.Default: false.
-
setFooterFormat
public void setFooterFormat(String footerFormat)
Sets a string to append to the tooltip format.
-
getFormat
public String getFormat()
Returns a format text of the tooltip.Default: null.
-
setFormat
public void setFormat(String format)
Sets a format text of the tooltip.Default: null.
-
getHeaderFormat
public String getHeaderFormat()
Returns the HTML of the tooltip header line. Variables are enclosed by curly brackets. Available variables arepoint.key,series.name,series.colorand other members from thepointandseriesobjects. Thepoint.keyvariable contains the category name, x value or datetime string depending on the type of axis. For datetime axes, thepoint.keydate format can be set using tooltip.xDateFormat.Default:
<span style="font-size: 10px">{point.key}</span><br/>
-
setHeaderFormat
public void setHeaderFormat(String headerFormat)
Sets the HTML of the tooltip header line. Variables are enclosed by curly brackets. Available variables arepoint.key,series.name,series.colorand other members from thepointandseriesobjects. Thepoint.keyvariable contains the category name, x value or datetime string depending on the type of axis. For datetime axes, thepoint.keydate format can be set using tooltip.xDateFormat.
-
getHideDelay
public Number getHideDelay()
Returns the number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.Default: 500.
-
setHideDelay
public void setHideDelay(Number hideDelay)
Sets the number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.
-
getPointFormat
public String getPointFormat()
Returns the HTML of the point's line in the tooltip. Variables are enclosed by curly brackets. Available variables are point.x, point.y, series.name and series.color and other properties on the same form. Furthermore, point.y can be extended by thetooltip.yPrefixandtooltip.ySuffixvariables. This can also be overridden for each series, which makes it a good hook for displaying units.Default:
<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>
-
setPointFormat
public void setPointFormat(String pointFormat)
Sets the HTML of the point's line in the tooltip. Variables are enclosed by curly brackets. Available variables are point.x, point.y, series.name and series.color and other properties on the same form. Furthermore, point.y can be extended by thetooltip.yPrefixandtooltip.ySuffixvariables. This can also be overridden for each series, which makes it a good hook for displaying units.
-
getValueDecimals
public Number getValueDecimals()
Returns how many decimals to show in each series' y value. This is overridable in each series' tooltip options object. The default is to preserve all decimals.Default: null.
-
setValueDecimals
public void setValueDecimals(Number valueDecimals)
Sets how many decimals to show in each series' y value. This is overridable in each series' tooltip options object. The default is to preserve all decimals.
-
getValuePrefix
public String getValuePrefix()
Returns a string to prepend to each series' y value. Overridable in each series' tooltip options object.Default: null.
-
setValuePrefix
public void setValuePrefix(String valuePrefix)
Sets a string to prepend to each series' y value. Overridable in each series' tooltip options object.
-
getValueSuffix
public String getValueSuffix()
Returns a string to append to each series' y value. Overridable in each series' tooltip options object.Default: null.
-
setValueSuffix
public void setValueSuffix(String valueSuffix)
Sets the string to append to each series' y value. Overridable in each series' tooltip options object.
-
getXDateFormat
public String getXDateFormat()
Returns the format for the date in the tooltip header if the X axis is a datetime axis. The default is a best guess based on the smallest distance between points in the chart.Default: null.
-
setXDateFormat
public void setXDateFormat(String xDateFormat)
Sets the format for the date in the tooltip header if the X axis is a datetime axis. The default is a best guess based on the smallest distance between points in the chart.
-
-