public class Tooltip extends AbstractConfigurationObject
Modifier and Type | Method and Description |
---|---|
Boolean |
getAnimation() |
Number |
getBorderRadius() |
Number |
getBorderWidth() |
Number |
getChangeDecimals() |
DateTimeLabelFormats |
getDateTimeLabelFormats() |
Boolean |
getEnabled() |
Boolean |
getFollowPointer() |
Boolean |
getFollowTouchMove() |
String |
getFooterFormat() |
String |
getFormatter() |
String |
getHeaderFormat() |
Number |
getHideDelay() |
Number |
getPadding() |
String |
getPointFormat() |
String |
getPointFormatter() |
String |
getPositioner() |
Boolean |
getShadow() |
Shape |
getShape() |
Boolean |
getShared() |
Number |
getSnap() |
Boolean |
getSplit() |
Boolean |
getUseHTML() |
Number |
getValueDecimals() |
String |
getValuePrefix() |
String |
getValueSuffix() |
String |
getXDateFormat() |
void |
setAnimation(Boolean animation)
Enable or disable animation of the tooltip.
|
void |
setBorderRadius(Number borderRadius)
The radius of the rounded border corners.
|
void |
setBorderWidth(Number borderWidth)
The pixel width of the tooltip border.
|
void |
setChangeDecimals(Number changeDecimals)
How many decimals to show for the
point.change value when
the series.compare option is set. |
void |
setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
For series on a datetime axes, the date format in the tooltip's header
will by default be guessed based on the closest data points.
|
void |
setEnabled(Boolean enabled)
Enable or disable the tooltip.
|
void |
setFollowPointer(Boolean followPointer)
Whether the tooltip should follow the mouse as it moves across columns,
pie slices and other point types with an extent.
|
void |
setFollowTouchMove(Boolean followTouchMove)
Whether the tooltip should follow the finger as it moves on a touch
device.
|
void |
setFooterFormat(String footerFormat)
A string to append to the tooltip format.
|
void |
setFormatter(String _fn_formatter) |
void |
setHeaderFormat(String headerFormat)
The HTML of the tooltip header line.
|
void |
setHideDelay(Number hideDelay)
The number of milliseconds to wait until the tooltip is hidden when mouse
out from a point or chart.
|
void |
setPadding(Number padding)
Padding inside the tooltip, in pixels.
|
void |
setPointFormat(String pointFormat)
The HTML of the point's line in the tooltip.
|
void |
setPointFormatter(String _fn_pointFormatter) |
void |
setPositioner(String _fn_positioner) |
void |
setShadow(Boolean shadow)
Whether to apply a drop shadow to the tooltip.
|
void |
setShape(Shape shape)
The name of a symbol to use for the border around the tooltip.
|
void |
setShared(Boolean shared)
When the tooltip is shared, the entire plot area will capture mouse
movement or touch events.
|
void |
setSnap(Number snap)
Proximity snap for graphs or single points.
|
void |
setSplit(Boolean split)
Split the tooltip into one label per series, with the header close to the
axis.
|
void |
setUseHTML(Boolean useHTML)
Use HTML to render the contents of the tooltip instead of SVG.
|
void |
setValueDecimals(Number valueDecimals)
How many decimals to show in each series' y value.
|
void |
setValuePrefix(String valuePrefix)
A string to prepend to each series' y value.
|
void |
setValueSuffix(String valueSuffix)
A string to append to each series' y value.
|
void |
setXDateFormat(String xDateFormat)
The format for the date in the tooltip header if the X axis is a datetime
axis.
|
public Tooltip()
public Tooltip(Boolean enabled)
public Boolean getAnimation()
setAnimation(Boolean)
public void setAnimation(Boolean animation)
Defaults to: true
public Number getBorderRadius()
setBorderRadius(Number)
public void setBorderRadius(Number borderRadius)
Defaults to: 3
public Number getBorderWidth()
setBorderWidth(Number)
public void setBorderWidth(Number borderWidth)
The pixel width of the tooltip border.
In styled mode, the stroke width is set in the
.highcharts-tooltip-box
class.
Defaults to: 1
public DateTimeLabelFormats getDateTimeLabelFormats()
public void setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
For 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 dateFormat.
Defaults to:
{ 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" }
public Boolean getEnabled()
setEnabled(Boolean)
public void setEnabled(Boolean enabled)
Defaults to: true
public Boolean getFollowPointer()
setFollowPointer(Boolean)
public void setFollowPointer(Boolean followPointer)
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 the
plotOptions
for those series types.
For touch moves to behave the same way,
followTouchMove must be
true
also.
Defaults to: false
public Boolean getFollowTouchMove()
setFollowTouchMove(Boolean)
public void setFollowTouchMove(Boolean followTouchMove)
true
and
chart.panning is set,
followTouchMove
will take over one-finger touches, so the
user needs to use two fingers for zooming and panning.
Defaults to: true
public String getFooterFormat()
setFooterFormat(String)
public void setFooterFormat(String footerFormat)
Defaults to: false
public String getFormatter()
public void setFormatter(String _fn_formatter)
public String getHeaderFormat()
setHeaderFormat(String)
public void setHeaderFormat(String headerFormat)
The HTML of the tooltip header line. Variables are enclosed by curly
brackets. Available variables are point.key
,
series.name
, series.color
and other members
from the point
and series
objects. The
point.key
variable contains the category name, x value or
datetime string depending on the type of axis. For datetime axes, the
point.key
date format can be set using tooltip.xDateFormat.
Defaults to
<span style="font-size: 10px">{point.key}</span><br/>
public Number getHideDelay()
setHideDelay(Number)
public void setHideDelay(Number hideDelay)
Defaults to: 500
public Number getPadding()
setPadding(Number)
public void setPadding(Number padding)
Defaults to: 8
public String getPointFormat()
setPointFormat(String)
public void setPointFormat(String pointFormat)
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 the tooltip.valuePrefix
and
tooltip.valueSuffix
variables. This can also be overridden
for each series, which makes it a good hook for displaying units.
In styled mode, the dot is colored by a class name rather than the point color.
Defaults to: ?
{series.name}: {point.y}
public String getPointFormatter()
public void setPointFormatter(String _fn_pointFormatter)
public String getPositioner()
public void setPositioner(String _fn_positioner)
public Boolean getShadow()
setShadow(Boolean)
public void setShadow(Boolean shadow)
Defaults to: true
public Shape getShape()
setShape(Shape)
public void setShape(Shape shape)
square
.
Defaults to: callout
public Boolean getShared()
setShared(Boolean)
public void setShared(Boolean shared)
When the tooltip is shared, the entire plot area will capture mouse movement or touch events. Tooltip texts for series types with ordered data (not pie, scatter, flags etc) will be shown in a single bubble. This is recommended for single series charts and for tablet/mobile optimized charts.
See also tooltip.split, that is better suited for charts with many series, especially line-type series.
Defaults to: false
public Number getSnap()
setSnap(Number)
public void setSnap(Number snap)
Proximity snap for graphs or single points. It defaults to 10 for mouse-powered devices and 25 for touch devices.
Note that in most cases the whole plot area captures the mouse movement,
and in these cases tooltip.snap
doesn't make sense. This
applies when
stickyTracking is
true
(default) and when the tooltip is
shared or
split.
public Boolean getSplit()
setSplit(Boolean)
public void setSplit(Boolean split)
Defaults to: false
public Boolean getUseHTML()
setUseHTML(Boolean)
public void setUseHTML(Boolean useHTML)
Defaults to: false
public Number getValueDecimals()
setValueDecimals(Number)
public void setValueDecimals(Number valueDecimals)
public String getValuePrefix()
setValuePrefix(String)
public void setValuePrefix(String valuePrefix)
public String getValueSuffix()
setValueSuffix(String)
public void setValueSuffix(String valueSuffix)
public String getXDateFormat()
setXDateFormat(String)
public void setXDateFormat(String xDateFormat)
public Number getChangeDecimals()
setChangeDecimals(Number)
public void setChangeDecimals(Number changeDecimals)
point.change
value when
the series.compare
option is set. This is overridable in
each series' tooltip options object. The default is to preserve all
decimals.Copyright © 2025. All rights reserved.