# Class: Tooltip

## Highcharts. Tooltip

#### new Tooltip(chart, options, pointer)

  Tooltip of a chart.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `chart` | Highcharts.Chart | The chart instance.
  `options` | Highcharts.TooltipOptions | Tooltip options.
  `pointer` | Highcharts.Pointer | The pointer instance.

### Members

#### <readonly> chart :Highcharts.Chart

  Chart of the tooltip.

  ##### Type:

  - Highcharts.Chart

#### container :Highcharts.HTMLDOMElement|undefined

  Reference to the tooltip's container, when [Highcharts.Tooltip#outside] is set to true, otherwise it's undefined.

  ##### Type:

  - Highcharts.HTMLDOMElement | undefined

#### <readonly> options :Highcharts.TooltipOptions

  Used tooltip options.

  ##### Type:

  - Highcharts.TooltipOptions

#### <readonly> options :Highcharts.TooltipOptions

  Used tooltip options.

  ##### Type:

  - Highcharts.TooltipOptions

#### <readonly> outside :boolean

  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.

  ##### Type:

  - boolean
  To Do:
    - Split tooltip does not support outside in the first iteration. Should not be too complicated to implement.

#### <readonly> outside :boolean

  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.

  ##### Type:

  - boolean
  To Do:
    - Split tooltip does not support outside in the first iteration. Should not be too complicated to implement.

#### renderer :Highcharts.SVGRenderer|undefined

  Reference to the tooltip's renderer, when [Highcharts.Tooltip#outside] is set to true, otherwise it's undefined.

  ##### Type:

  - Highcharts.SVGRenderer | undefined

#### <readonly> shared :boolean|undefined

  When the tooltip is shared, the entire plot area will capture mouse movement or touch events.

  ##### Type:

  - boolean | undefined

#### <readonly> split :boolean|undefined

  True, if the tooltip is split into one label per series, with the header close to the axis.

  ##### Type:

  - boolean | undefined

### Methods

#### defaultFormatter(tooltip)

  In case no user defined formatter is given, this will be used. Note that the context here is an object holding point, series, x, y etc.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `tooltip` | Highcharts.Tooltip |

  ##### Returns:

  string | Array.<string> .

  Returns a string (single tooltip and shared) or an array of strings (split tooltip)

#### destroy()

  Removes and destroys the tooltip and its elements.

#### getClassName()

  Get the CSS class names for the tooltip's label. Styles the label by `colorIndex` or user-defined CSS.

  ##### Returns:

  string .

  The class names.

#### getLabel()

  Creates the Tooltip label element if it does not exist, then returns it.

  ##### Returns:

  Highcharts.SVGElement .

  Tooltip label

#### getPosition(boxWidth, boxHeight, point)

  Place the tooltip in a chart without spilling over and not covering the point itself.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `boxWidth` | number | Width of the tooltip box.
  `boxHeight` | number | Height of the tooltip box.
  `point` | Highcharts.Point | Tooltip related point.

  ##### Returns:

  Highcharts.PositionObject .

  Recommended position of the tooltip.

#### hide( [delay])

  Hides the tooltip with a fade out animation.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `delay` | number | <optional> | The fade out in milliseconds. If no value is provided the value of the tooltip.hideDelay option is used. A value of 0 disables the fade out animation.

#### refresh(pointOrPoints [, mouseEvent])

  Refresh the tooltip's text and position.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `pointOrPoints` | Highcharts.Point | Array.<Highcharts.Point> |  | Either a point or an array of points.
  `mouseEvent` | Highcharts.PointerEventObject | <optional> | Mouse event, that is responsible for the refresh and should be used for the tooltip update.

#### update(options)

  Updates the tooltip with the provided tooltip options.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `options` | Highcharts.TooltipOptions | The tooltip options to update.