|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.moxieapps.gwt.highcharts.client.Configurable<ToolTip> org.moxieapps.gwt.highcharts.client.ToolTip
public class ToolTip
A configurable class that can be used to represent custom ToolTip options for the
chart, which can then be set on the chart (via the BaseChart.setToolTip(ToolTip)
method.)
The tooltip appears when the user hovers over a series or point.
Example usage:
chart.setToolTip(
new ToolTip()
.setBorderColor("#CC0000")
.setShadow(true)
);
Constructor Summary | |
---|---|
ToolTip()
|
Method Summary | |
---|---|
ToolTip |
setAnimation(boolean animation)
Convenience method for setting the 'animation' option for the tool tips. |
ToolTip |
setBackgroundColor(Color backgroundColor)
Convenience method for setting the 'backgroundColor' option for the tool tips to a gradient or color with an alpha channel . |
ToolTip |
setBackgroundColor(String backgroundColor)
Convenience method for setting the 'backgroundColor' option for the tool tips. |
ToolTip |
setBorderColor(Color borderColor)
Convenience method for setting the 'borderColor' option for the tool tips to a gradient or color with an alpha channel . |
ToolTip |
setBorderColor(String borderColor)
Convenience method for setting the 'borderColor' option for the tool tips. |
ToolTip |
setBorderRadius(Number borderRadius)
Convenience method for setting the 'borderRadius' option for the tool tips. |
ToolTip |
setBorderWidth(Number borderWidth)
Convenience method for setting the 'borderWidth' option for the tool tips. |
ToolTip |
setChangeDecimal(Number changeDecimal)
convenience method for setting the 'changeDecimal' option for the tool tips. |
ToolTip |
setCrosshairs(boolean crosshairs)
Convenience method for setting the 'crosshairs' option for the tool tips for both axis. |
ToolTip |
setCrosshairs(boolean xCrosshairs,
boolean yCrosshairs)
Convenience method for setting the 'crosshairs' option for the tool tips for each axis separately. |
ToolTip |
setEnabled(boolean enabled)
Convenience method for setting the 'enabled' option for the tool tips. |
ToolTip |
setFollowPointer(boolean followPointer)
Convenience method for setting the 'followPointer' option for the tool tips. |
ToolTip |
setFollowTouchMove(boolean followTouchMove)
Convenience method for setting the 'enabled' option for the tool tips. |
ToolTip |
setFormatter(ToolTipFormatter toolTipFormatter)
Sets a custom formatter on the tooltip that can be used to control the contents and styling of the text that appears in the tooltip. |
ToolTip |
setHeaderFormat(String headerFormat)
Convenience method for setting the 'headerFormat' option for the tool tips. |
ToolTip |
setHideDelay(Number hideDelay)
Convenience method for setting the 'hideDelay' option of the tool tip. |
ToolTip |
setPointFormat(String pointFormat)
Convenience method for setting the 'pointFormat' option for the tool tips. |
ToolTip |
setShadow(boolean shadow)
Convenience method for setting the 'shadow' option for the tool tips. |
ToolTip |
setShared(boolean shared)
Convenience method for setting the 'shared' option for the tool tips. |
ToolTip |
setSnap(Number snap)
Convenience method for setting the 'snap' option for the tool tips. |
ToolTip |
setStyle(Style style)
Convenience method for setting the 'style' options of the tooltip. |
ToolTip |
setUseHTML(boolean useHTML)
Convenience method for setting the 'useHTML' option for the tool tips. |
ToolTip |
setValueDecimals(Number valueDecimals)
Convenience method for setting the 'valueDecimals' option for the tool tips. |
ToolTip |
setValuePrefix(String valuePrefix)
Convenience method for setting the 'valuePrefix' option for the tool tips. |
ToolTip |
setValueSuffix(String valueSuffix)
Convenience method for setting the 'valueSuffix' option for the tool tips. |
ToolTip |
setXDateFormat(String xDateFormat)
Convenience method for setting the 'xDateFormat' option for the tool tips. |
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable |
---|
getOptions, setOption |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolTip()
Method Detail |
---|
public ToolTip setAnimation(boolean animation)
toolTip.setOption("animation", "true");
Enable or disable animation of the tooltip. In slow legacy IE browsers the animation is disabled by default.
Defaults to true.
animation
- Whether to enable or disable animation of the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setBackgroundColor(String backgroundColor)
toolTip.setOption("backgroundColor", "#CCCCCC");
The RGB background color for the tooltip. Defaults to white with a slight opacity.
Note that this method is intended for setting the color to a simple RBG hex value. If you instead
want to set a color to include an alpha channel or a gradient, use the
setBackgroundColor(Color)
method.
backgroundColor
- The RGB background color for the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setBackgroundColor(Color backgroundColor)
toolTip.setOption("backgroundColor", new Color()
.setLinearGradient(0.0, 0.0, 1.0, 1.0)
.addStop(new Color(255, 255, 255))
.addStop(new Color(200, 200, 255))
));
The background color for the tooltip (as a gradient or color with an alpha channel). Defaults to "rgba(255, 255, 255, .85)".
Note that this method is intended for setting the background to a gradient or color with an alpha
channel. If you instead want to just set the color to a standard RGB hex value use the
setBackgroundColor(String)
method instead.
backgroundColor
- The color gradient or color with an alpha channel to set as the 'backgroundColor' option on the tool tip.
ToolTip
instance for convenient method chaining.public ToolTip setBorderColor(String borderColor)
toolTip.setOption("borderColor", "#CCCCCC");
The color of the tooltip border. When null, the border takes the color of the corresponding series or point.
Defaults to "auto".
Note that this method is intended for setting the color to a simple RBG hex value. If you instead
want to set a color to include an alpha channel or a gradient, use the
setBorderColor(Color)
method.
borderColor
- The color of the tooltip border.
ToolTip
instance for convenient method chaining.public ToolTip setBorderColor(Color borderColor)
toolTip.setOption("borderColor", new Color()
.setLinearGradient(0.0, 0.0, 1.0, 1.0)
.addStop(new Color(255, 255, 255))
.addStop(new Color(200, 200, 255))
));
The border color for the tooltip (as a gradient or color with an alpha channel). When null, the border
takes the color of the corresponding series or point. Defaults to "auto".
Note that this method is intended for setting the border to a gradient or color with an alpha
channel. If you instead want to just set the color to a standard RGB hex value use the
setBackgroundColor(String)
method instead.
borderColor
- The color gradient or color with an alpha channel to set as the 'borderColor' option on the tool tip.
ToolTip
instance for convenient method chaining.public ToolTip setBorderRadius(Number borderRadius)
toolTip.setOption("borderRadius", 8);
The radius of the rounded border corners. Defaults to 5.
borderRadius
- The radius of the rounded border corners.
ToolTip
instance for convenient method chaining.public ToolTip setBorderWidth(Number borderWidth)
toolTip.setOption("borderWidth", 3);
The pixel width of the tooltip border. Defaults to 2.
borderWidth
- The pixel width of the tooltip border.
ToolTip
instance for convenient method chaining.public ToolTip setChangeDecimal(Number changeDecimal)
toolTip.setOption("changeDecimal", 5);
How many decimals to show for the 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.
changeDecimal
- The number of decimals to show.
ToolTip
instance for convenient method chaining.public ToolTip setCrosshairs(boolean crosshairs)
toolTip.setOption("crosshairs", true);
Display crosshairs to connect the points with their corresponding axis values. Crosshairs are disabled
by default.
Note that see the overloaded versions of this method for other ways to control the crosshair configurations.
crosshairs
- Whether or not to display crosshairs to connect the points with their corresponding axis values.
ToolTip
instance for convenient method chaining.public ToolTip setCrosshairs(boolean xCrosshairs, boolean yCrosshairs)
toolTip.setOption("crosshairs", true, true);
Display crosshairs to connect the points with their corresponding axis values. Crosshairs are disabled
by default.
Note that see the overloaded versions of this method for other ways to control the crosshair configurations.
xCrosshairs
- Whether or not to display the x axis crosshair.yCrosshairs
- Whether or not to display the y axis crosshair.
ToolTip
instance for convenient method chaining.public ToolTip setEnabled(boolean enabled)
toolTip.setOption("enabled", false);
Enable or disable the tool tips. Defaults to true.
enabled
- Whether or not to enable or disable the tool tips.
ToolTip
instance for convenient method chaining.public ToolTip setFollowPointer(boolean followPointer)
toolTip.setOption("followPointer", true);
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, setFollowTouchMove(boolean)
must be true also.
followPointer
- 'true' to make the tooltip follow the mouse pointer.
ToolTip
instance for convenient method chaining.public ToolTip setFollowTouchMove(boolean followTouchMove)
toolTip.setOption("followTouchMove", true);
Whether the tooltip should follow the finger as it moves on a touch device.
The default value of false causes a touch move to scroll the web page, as is default behaviour
on touch devices. Setting it to true may cause the user to be trapped inside the chart and
unable to scroll away, so it should be used with care. Defaults to false.
followTouchMove
- 'true' to make the tooltip follow a finger on a touch device.
ToolTip
instance for convenient method chaining.public ToolTip setFormatter(ToolTipFormatter toolTipFormatter)
ToolTipFormatter
interface, and
in particular the ToolTipFormatter.format(ToolTipData)
method for more details on
the capabilities available to custom formatters.
Note that for more simple custom point format cases see the setPointFormat(String)
mechanism instead.
toolTipFormatter
- The custom formatter to use for the tooltips (if not given a built-in
generic formatter is used when tooltips are enabled).
ToolTip
instance for convenient method chaining.public ToolTip setHeaderFormat(String headerFormat)
toolTip.setOption("headerFormat", "<span style=\"font-size: 10px\">{point.key}</span><br/>")
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 setXDateFormat(String)
.
Defaults to <span style="font-size: 10px">{point.key}</span><br/>
headerFormat
- The HTML of the tool tip header
ToolTip
instance for convenient method chaining.public ToolTip setHideDelay(Number hideDelay)
toolTip.setOption("hideDelay", 500)
The number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart. Defaults to 500.
hideDelay
- the number of miliseconds to wait before hiding the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setPointFormat(String pointFormat)
toolTip.setOption("pointFormat", "{point.y});
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.yPrefix and tooltip.ySuffix variables. This can also be overridden for each
series, which makes it a good hook for displaying units.
Defaults to <span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>
Note that for more advanced use cases, see thesetFormatter(ToolTipFormatter)
mechanism instead.
pointFormat
- The HTML of the point's line in the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setShadow(boolean shadow)
toolTip.setOption("shadow", false);
Whether to apply a drop shadow to the tooltip. Defaults to true.
shadow
- Whether to apply a drop shadow to the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setShared(boolean shared)
toolTip.setOption("shared", true);
When the tooltip is shared, the entire plot area will capture mouse movement, and tooltip
texts for all series will be shown in a single bubble. This is recommended for single series
charts and for iPad optimized sites. Defaults to false.
shared
- Whether or not to shared the same tool tip between points.
ToolTip
instance for convenient method chaining.public ToolTip setSnap(Number snap)
toolTip.setOption("snap", 40);
Proximity snap for graphs or single points. Does not apply to bars, columns and pie slices.
It defaults to 10 for mouse-powered devices and 25 for touch devices.
snap
- The proximity snap for graphs or single points.
ToolTip
instance for convenient method chaining.public ToolTip setStyle(Style style)
toolTip.setOption("/style/fontWeight", "bold");
toolTip.setOption("/style/fontFamily", "serif");
etc.
CSS styles for the tooltip. The tooltip can also be styled through the CSS
class ".highcharts-tooltip". Default value:
style
- CSS styles for the tooltip.
ToolTip
instance for convenient method chaining.public ToolTip setValueDecimals(Number valueDecimals)
toolTip.setOption("valueDecimals", 3);
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.
valueDecimals
- How many decimals to show in each series' y value.
ToolTip
instance for convenient method chaining.public ToolTip setValuePrefix(String valuePrefix)
toolTip.setOption("valuePrefix", "$");
A string to prepend to each series' y value. Overridable in each series' tooltip options
object. Defaults to "".
valuePrefix
- The string to prepend to each series' y value.
ToolTip
instance for convenient method chaining.public ToolTip setValueSuffix(String valueSuffix)
toolTip.setOption("valueSuffix", " cents");
A string to append to each series' y value. Overridable in each series' tooltip options
object. Defaults to "".
valueSuffix
- The string to append to each series' y value.
ToolTip
instance for convenient method chaining.public ToolTip setXDateFormat(String xDateFormat)
toolTip.setOption("xDateFormat", "%Y-%m-%d");
The format for the date in the tooltip header if the X axis is a datetime axis.
xDateFormat
- The format for the date in the tooltip header if the X axis is a datetime axis.
ToolTip
instance for convenient method chaining.public ToolTip setUseHTML(boolean useHTML)
toolTip.setOption("useHTML", true);
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.
useHTML
- Use HTML to render the contents of the tooltip instead of SVG.
ToolTip
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |