Class: Tooltip

PD.SVG. Tooltip

Manages a fading tooltip.


new Tooltip(config)

Creates a fading tooltip.

Parameters:
Name Type Description
config object

An optional configuration object with the following properties.

Properties of config:
Name Type Argument Description
title string <optional>

The text to display in the tooltip.

Author:
  • drajmarsh

Members


:SVGElement

group

The SVG container element for the tooltip.

Type
  • SVGElement

:number

height

The height of the tooltip in drawing units.

Type
  • number

:string

text

The text to display within the tooltip.

Type
  • string

:boolean

visible

Whether or not the tooltip is currently visible.

Type
  • boolean

:number

width

The width of the tooltip in drawing units.

Type
  • number

Methods


hide()

Fades the tooltip out and removes it from view.

Returns:

Returns this tooltip to support method chaining.

Type
object

setPos(x, x)

Sets the position of the tooltip center within its container element.

Parameters:
Name Type Description
x number

The horizontal position within the container.

x number

The vertical position within the container.

Returns:

Returns this tooltip to support method chaining.

Type
object

setText(text)

Sets the text to display in the tooltip.

Parameters:
Name Type Description
text string

The text value to display.

Returns:

Returns this tooltip to support method chaining.

Type
object

show( [timeout])

Adds the tooltip to the view and fades it in.

Parameters:
Name Type Argument Description
timeout number <optional>

The amount of time the tooltip stays visible in milliseconds, defaults to infinity.

Returns:

Returns this tooltip to support method chaining.

Type
object