tooltip

Specifies tooltip options.

Type: Object

A tooltip is a small pop-up rectangle that displays information about a hovered series point. You can enable or disable tooltips, format or customize the displayed text, and change the default appearance. Use the properties of the tooltip configuration object to do this. To learn more on tooltips and their options, refer to the Tooltips topic.

Show Example:
jQuery

In this example, the tooltips are enabled. Hover over any point to see a tooltip.


                                    

                                    

argumentFormat

Specifies a format for arguments of the chart's series points.

Type: String
Default Value: ''
Accepted Values: 'currency' | 'fixedPoint' | 'percent' | 'decimal' | 'exponential' | 'largeNumber' | 'thousands' | 'millions' | 'billions' | 'trillions' | 'longDate' | 'longTime' | 'monthAndDay' | 'monthAndYear' | 'quarterAndYear' | 'shortDate' | 'shortTime' | 'millisecond' | 'day' | 'month' | 'quarter' | 'year'

Use this property to set a format for arguments when they are displayed in tooltips. For a list of acceptable formats, refer to the format property. To learn how to set custom text for tooltips so that they include an argument value for the point that is currently hovered, refer to the customizeText property. For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

The example below shows a chart with formatted tooltip text. The tooltip displays the argument of the corresponding point in a 'monthAndDay' format.


                                    

                                    

argumentPrecision

Specifies a precision for formatted arguments displayed in tooltips.

Type: Number
Default Value: 0

This property's value must be an integer indicating how many digits to show in the argument displayed in tooltips. This property value is considered when tooltips display arguments in one of the following numeric formats: 'fixedPoint', 'exponential', 'currency', 'percent'. To learn how to set a format for arguments, refer to the argumentFormat property description. To learn how to set a custom text for tooltips so that they include an argument value of the currently hovered point, refer to the customizeText property description. For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

The example below represents a chart with formatted tooltip text. The tooltip displays the combination of the point's argument and value. The argument is formatted as a fixed-point number with the precision of 2.


                                    

                                    

arrowLength

Specifies the length of the tooltips' arrow, in pixels.

Type: Number
Default Value: 10

Show Example:
jQuery

In this example, the tooltip's arrowLength option is set to 30.


                                    

                                    

color

Specifies a color for the chart's tooltips.

Type: String
Default Value: undefined

Tooltips are displayed in the color of the currently hovered series by default. You can set a custom color for all tooltips in a chart. To do this, use the color property of the tooltip object. This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, the tooltip's color option is set to limegreen.


                                    

                                    

customizeText

Specifies a callback function that returns the text to be displayed by tooltips.

Type: function(pointInfo)
Function parameters:
pointInfo: Object

Defines the point value to be displayed in a tooltip.

Return Value: String

The text to be displayed in a tooltip.

When implementing a callback function for this property, use the point value to be displayed in a tooltip. In addition, you can use the argument of the currently displayed value. These values can be accessed using the following properties of the this object.

  • originalValue
    Specifies the value of the currently represented point as it is set in the data source.
  • value
    Specifies the value of the currently represented point. Differs from the originalValue when the axis value type differs from the value type in the data source. In this instance, value has the type of the value axis.
  • valueText
    Specifies the value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.
  • valueText (for candle stick and stock series)
    Specifies a string of values of the currently represented point. This string encloses the highValueText, openValueText, closeValueText and lowValueText values.
    The format of the string is as follows: "h: %highValueText% o: %openValueText% c: %closeValueText% l: %lowValueText%".
  • originalArgument
    Specifies the argument value of the currently represented point as it is set in the data source.
  • argument
    Specifies the argument value of the currently represented point. Differs from the originalValue when the axis' argument type differs from the argument type in the data source. In this instance, argument has the type of the argument axis.
  • argumentText
    Specifies the argument value of the currently hovered point with applied formatting if the argumentFormat and argumentPrecision (optional) properties are specified.
  • size (for bubble series only)
    Specifies the automatically calculated size of the hovered bubble.
  • seriesName
    Specifies the series of the currently hovered point.
  • point
    Provides access to the hovered point. To learn more about the field and methods of the point object, refer to the Point topic in the "Chart Elements" reference section.
  • points (for shared tooltip only)
    Provides access to the array of points with the same argument as the currently hovered point. This field is accessible when the shared option of the tooltip object is set to true. To learn more about the fields and methods of the point object, refer to the Point topic in the "Chart Elements" reference section.

The following fields are available for the stacked-like series such as stacked bar or full-stacked area.

  • percent
    Specifies the percent value of the currently hovered point.
  • percentText
    Specifies the percent value of the currently hovered point with the 'percent' format and percentPrecision (optional) applied.
  • total
    Specifies the total value of all points with the same argument as the currently hovered point.
  • totalText
    Specifies the total value of all points with the same argument as the currently hovered point. This value is displayed with applied formatting if the format and precision (optional) properties are specified.

The following fields are available for financial chart series such as candle stick or stock.

  • originalOpenValue
    Specifies the open value of the currently hovered point as it is set in the data source.
  • openValue
    Specifies the open value of the currently hovered point. Differs from the originalOpenValue when the value in the data source is not in a numeric format.
  • openValueText
    Specifies the open value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.
  • originalCloseValue
    Specifies the close value of the currently hovered point as it is set in the data source.
  • closeValue
    Specifies the close value of the currently hovered point. Differs from the originalCloseValue when the value in the data source is not in a numeric format.
  • closeValueText
    Specifies the close value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.
  • originalHighValue
    Specifies the high value of the currently hovered point as it is set in the data source.
  • highValue
    Specifies the high value of the currently hovered point. Differs from the originalHighValue when the value in the data source is not in a numeric format.
  • highValueText
    Specifies the high value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.
  • originalLowValue
    Specifies the low value of the currently hovered point as it is set in the data source.
  • lowValue
    Specifies the low value of the currently hovered point. Differs from the originalLowValue when the value in the data source is not in a numeric format.
  • lowValueText
    Specifies the low value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.
  • reductionValue
    Specifies the reduction value of the currently hovered point.
  • reductionValueText
    Specifies the reduction value of the currently hovered point with applied formatting if the format and precision (optional) properties are specified.

The function's parameter represents the same object as the this object. If appropriate, you can use the function's parameter to obtain the value that is currently represented by a tooltip.

To get general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

In the example below, the tooltip text is customized so that both the argument and value of a point are displayed in the tooltip.


                                    

                                    

enabled

Specifies whether tooltips are enabled in the chart.

Type: Boolean
Default Value: false
Accepted Values: true|false

Show Example:
jQuery

In the example below, use the check box to enable/disable tooltips. Hover over any point of the chart to see the effect.


                                    

                                    

font

Specifies font options for the text displayed by tooltips.

Type: Object

Show Example:
jQuery

In this example, the font options of the tooltip text are altered.


                                    

                                    

format

Specifies a format for the text displayed by tooltips.

Type: String
Default Value: ''
Accepted Values: 'currency' | 'fixedPoint' | 'percent' | 'decimal' | 'exponential' | 'largeNumber' | 'thousands' | 'millions' | 'billions' | 'trillions' | 'longDate' | 'longTime' | 'monthAndDay' | 'monthAndYear' | 'quarterAndYear' | 'shortDate' | 'shortTime' | 'millisecond' | 'day' | 'month' | 'quarter' | 'year'

Tooltips display the value(s) of the point that is currently being hovered over by default. You can apply formatting to this value using one of the available formats.

NOTE: You can set a precision for a tooltip value when the 'fixedPoint', 'exponential', 'currency' or 'percent' format is applied. Use the precision and argumentPrecision properties to do this.

For details on formatting, refer to the Data Formatting topic.

Show Example:
jQuery

The example below represents a chart with formatted tooltip text. The tooltip displays the value of the hovered point in the 'largeNumber' format.


                                    

                                    

paddingLeftRight

Specifies the blank space between a tooltip's left/right boundaries and the inner text, in pixels.

Type: Number
Default Value: 24

TooltipPadding ChartJS

paddingTopBottom

Specifies the blank space between a tooltip's top/bottom boundaries and the inner text, in pixels.

Type: Number
Default Value: 6

TooltipPadding ChartJS

percentPrecision

Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series.

Type: Number
Default Value: 0

To display a percent value in tooltips, use the customizeText callback function. Return the percent or percentText property value of the this object that is available in the function.

Show Example:
jQuery

In this example, the tooltip text for a full-stacked-bar series type is displayed as a percentage value. The precision of this value is set to 2 digits after the comma using the percentPrecision option.


                                    

                                    

precision

Specifies a precision for formatted values displayed in tooltips.

Type: Number
Default Value: 0

This property's value must be an integer indicating how many digits to show in the value displayed in tooltips. This property value is considered when tooltips display values in one of the following numeric formats: 'fixedPoint', 'exponential', 'currency', 'percent'. To learn how to set a format for point values, refer to the format property description. For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

The example below shows a chart with formatted tooltip text. The tooltip displays the value of the corresponding point in the 'fixedPoint' format with a presicion of 2.


                                    

                                    

shared

Specifies the kind of information to display in a tooltip.

Type: Boolean
Default Value: false
Accepted Values: true | false

By default, a tooltip displays information about the currently hovered series point. If you set the shared option to true, the tooltip will display information about all the points that have the same argument as the hovered point at once.

If the text displayed in the tooltip by default doesn't suit your needs, you can customize it using the customizeText option.

Show Example:
jQuery

Toggle the check box below to switch between the values of the tooltip | shared option. Hover over any point on the chart to see the effect.