Class Tooltip
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.model.Tooltip
-
- All Implemented Interfaces:
Serializable
public class Tooltip extends AbstractConfigurationObject
Options for the tooltip that appears when the user hovers over a series or point.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleangetAnimation()ColorgetBackgroundColor()ColorgetBorderColor()NumbergetBorderRadius()NumbergetBorderWidth()NumbergetChangeDecimals()DateTimeLabelFormatsgetDateTimeLabelFormats()BooleangetEnabled()BooleangetFollowPointer()BooleangetFollowTouchMove()StringgetFooterFormat()StringgetFormatter()StringgetHeaderFormat()NumbergetHideDelay()BooleangetOutside()NumbergetPadding()StringgetPointFormat()StringgetPointFormatter()StringgetPositioner()BooleangetShadow()ShapegetShape()BooleangetShared()NumbergetSnap()BooleangetSplit()StylegetStyle()BooleangetUseHTML()NumbergetValueDecimals()StringgetValuePrefix()StringgetValueSuffix()StringgetXDateFormat()voidsetAnimation(Boolean animation)Enable or disable animation of the tooltip.voidsetBackgroundColor(Color backgroundColor)The background color or gradient for the tooltip.voidsetBorderColor(Color borderColor)The color of the tooltip border.voidsetBorderRadius(Number borderRadius)The radius of the rounded border corners.voidsetBorderWidth(Number borderWidth)The pixel width of the tooltip border.voidsetChangeDecimals(Number changeDecimals)How many decimals to show for thepoint.changevalue when theseries.compareoption is set.voidsetDateTimeLabelFormats(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.voidsetEnabled(Boolean enabled)Enable or disable the tooltip.voidsetFollowPointer(Boolean followPointer)Whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an extent.voidsetFollowTouchMove(Boolean followTouchMove)Whether the tooltip should follow the finger as it moves on a touch device.voidsetFooterFormat(String footerFormat)A string to append to the tooltip format.voidsetFormatter(String _fn_formatter)voidsetHeaderFormat(String headerFormat)The HTML of the tooltip header line.voidsetHideDelay(Number hideDelay)The number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.voidsetOutside(Boolean outside)Whether to allow the tooltip to render outside the chart's SVG element box.voidsetPadding(Number padding)Padding inside the tooltip, in pixels.voidsetPointFormat(String pointFormat)The HTML of the point's line in the tooltip.voidsetPointFormatter(String _fn_pointFormatter)voidsetPositioner(String _fn_positioner)voidsetShadow(Boolean shadow)Whether to apply a drop shadow to the tooltip.voidsetShape(Shape shape)The name of a symbol to use for the border around the tooltip.voidsetShared(Boolean shared)When the tooltip is shared, the entire plot area will capture mouse movement or touch events.voidsetSnap(Number snap)Proximity snap for graphs or single points.voidsetSplit(Boolean split)Split the tooltip into one label per series, with the header close to the axis.voidsetStyle(Style style)CSS styles for the tooltip.voidsetUseHTML(Boolean useHTML)Use HTML to render the contents of the tooltip instead of SVG.voidsetValueDecimals(Number valueDecimals)How many decimals to show in each series' y value.voidsetValuePrefix(String valuePrefix)A string to prepend to each series' y value.voidsetValueSuffix(String valueSuffix)A string to append to each series' y value.voidsetXDateFormat(String xDateFormat)The format for the date in the tooltip header if the X axis is a datetime axis.
-
-
-
Constructor Detail
-
Tooltip
public Tooltip()
-
Tooltip
public Tooltip(Boolean enabled)
-
-
Method Detail
-
getAnimation
public Boolean getAnimation()
- See Also:
setAnimation(Boolean)
-
setAnimation
public void setAnimation(Boolean animation)
Enable or disable animation of the tooltip. In slow legacy IE browsers the animation is disabled by default.Defaults to: true
-
getBackgroundColor
public Color getBackgroundColor()
- See Also:
setBackgroundColor(Color)
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
The background color or gradient for the tooltip.
In styled mode, the stroke width is set in the
.highcharts-tooltip-boxclass.Defaults to: rgba(247,247,247,0.85)
-
getBorderColor
public Color getBorderColor()
- See Also:
setBorderColor(Color)
-
setBorderColor
public void setBorderColor(Color borderColor)
The color of the tooltip border. Whennull, the border takes the color of the corresponding series or point.Defaults to: null
-
getBorderRadius
public Number getBorderRadius()
- See Also:
setBorderRadius(Number)
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
The radius of the rounded border corners.Defaults to: 3
-
getBorderWidth
public Number getBorderWidth()
- See Also:
setBorderWidth(Number)
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
The pixel width of the tooltip border.
In styled mode, the stroke width is set in the
.highcharts-tooltip-boxclass.Defaults to: 1
-
getDateTimeLabelFormats
public DateTimeLabelFormats getDateTimeLabelFormats()
-
setDateTimeLabelFormats
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" }
-
getEnabled
public Boolean getEnabled()
- See Also:
setEnabled(Boolean)
-
setEnabled
public void setEnabled(Boolean enabled)
Enable or disable the tooltip.Defaults to: true
-
getFollowPointer
public Boolean getFollowPointer()
- See Also:
setFollowPointer(Boolean)
-
setFollowPointer
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
plotOptionsfor those series types.For touch moves to behave the same way, followTouchMove must be
truealso.Defaults to: false
-
getFollowTouchMove
public Boolean getFollowTouchMove()
- See Also:
setFollowTouchMove(Boolean)
-
setFollowTouchMove
public void setFollowTouchMove(Boolean followTouchMove)
Whether the tooltip should follow the finger as it moves on a touch device. If this istrueand chart.panning is set,followTouchMovewill take over one-finger touches, so the user needs to use two fingers for zooming and panning.Defaults to: true
-
getFooterFormat
public String getFooterFormat()
- See Also:
setFooterFormat(String)
-
setFooterFormat
public void setFooterFormat(String footerFormat)
A string to append to the tooltip format.Defaults to: false
-
getFormatter
public String getFormatter()
-
setFormatter
public void setFormatter(String _fn_formatter)
-
getHeaderFormat
public String getHeaderFormat()
- See Also:
setHeaderFormat(String)
-
setHeaderFormat
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.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.Defaults to
<span style="font-size: 10px">{point.key}</span><br/>
-
getHideDelay
public Number getHideDelay()
- See Also:
setHideDelay(Number)
-
setHideDelay
public void setHideDelay(Number hideDelay)
The number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart.Defaults to: 500
-
getPadding
public Number getPadding()
- See Also:
setPadding(Number)
-
setPadding
public void setPadding(Number padding)
Padding inside the tooltip, in pixels.Defaults to: 8
-
getPointFormat
public String getPointFormat()
- See Also:
setPointFormat(String)
-
setPointFormat
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.valuePrefixandtooltip.valueSuffixvariables. 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}
-
getPointFormatter
public String getPointFormatter()
-
setPointFormatter
public void setPointFormatter(String _fn_pointFormatter)
-
getPositioner
public String getPositioner()
-
setPositioner
public void setPositioner(String _fn_positioner)
-
getShadow
public Boolean getShadow()
- See Also:
setShadow(Boolean)
-
setShadow
public void setShadow(Boolean shadow)
Whether to apply a drop shadow to the tooltip.Defaults to: true
-
getShape
public Shape getShape()
- See Also:
setShape(Shape)
-
setShape
public void setShape(Shape shape)
The name of a symbol to use for the border around the tooltip. In Highcharts 3.x and less, the shape wassquare.Defaults to: callout
-
getShared
public Boolean getShared()
- See Also:
setShared(Boolean)
-
setShared
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
-
getSnap
public Number getSnap()
- See Also:
setSnap(Number)
-
setSnap
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.snapdoesn't make sense. This applies when stickyTracking istrue(default) and when the tooltip is shared or split.
-
getSplit
public Boolean getSplit()
- See Also:
setSplit(Boolean)
-
setSplit
public void setSplit(Boolean split)
Split the tooltip into one label per series, with the header close to the axis. This is recommended over shared tooltips for charts with multiple line series, generally making them easier to read.Defaults to: false
-
getStyle
public Style getStyle()
- See Also:
setStyle(Style)
-
setStyle
public void setStyle(Style style)
CSS styles for the tooltip. The tooltip can also be styled through the CSS class.highcharts-tooltip.Defaults to: { "color": "#333333", "cursor": "default", "fontSize": "12px", "pointerEvents": "none", "whiteSpace": "nowrap" }
-
getUseHTML
public Boolean getUseHTML()
- See Also:
setUseHTML(Boolean)
-
setUseHTML
public void setUseHTML(Boolean useHTML)
Use HTML to render the contents of the tooltip instead of SVG. Using HTML allows advanced formatting like tables and images in the tooltip. It is also recommended for rtl languages as it works around rtl bugs in early Firefox.Defaults to: false
-
getValueDecimals
public Number getValueDecimals()
- See Also:
setValueDecimals(Number)
-
setValueDecimals
public void setValueDecimals(Number valueDecimals)
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()
- See Also:
setValuePrefix(String)
-
setValuePrefix
public void setValuePrefix(String valuePrefix)
A string to prepend to each series' y value. Overridable in each series' tooltip options object.
-
getValueSuffix
public String getValueSuffix()
- See Also:
setValueSuffix(String)
-
setValueSuffix
public void setValueSuffix(String valueSuffix)
A string to append to each series' y value. Overridable in each series' tooltip options object.
-
getXDateFormat
public String getXDateFormat()
- See Also:
setXDateFormat(String)
-
setXDateFormat
public void setXDateFormat(String xDateFormat)
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.
-
getChangeDecimals
public Number getChangeDecimals()
- See Also:
setChangeDecimals(Number)
-
setChangeDecimals
public void setChangeDecimals(Number changeDecimals)
How many decimals to show for thepoint.changevalue when theseries.compareoption is set. This is overridable in each series' tooltip options object. The default is to preserve all decimals.
-
getOutside
public Boolean getOutside()
- See Also:
setOutside(Boolean)
-
setOutside
public void setOutside(Boolean outside)
Whether to allow the tooltip to render outside the chart's SVG element box. By default (false), the tooltip is rendered within the chart's SVG element, which results in the tooltip being aligned inside the chart area. For small charts, this may result in clipping or overlapping. When true, a separate SVG element is created and overlaid on the page, allowing the tooltip to be aligned inside the page itself.
-
-