ComponentOne ASP.NET MVC Controls
ChartTooltip Class
File
wijmo.chart.js
Module
wijmo.chart
Base Class
Tooltip

Extends the Tooltip class to provide chart tooltips.

Constructor

Properties

Methods

Events

Constructor

constructor

constructor(): ChartTooltip

Initializes a new instance of the ChartTooltip class.

Returns
ChartTooltip

Properties

content

Gets or sets the tooltip content.

The tooltip content can be specified as a string or as a function that takes a HitTestInfo object as a parameter.

When the tooltip content is a string, it may contain any of the following parameters:

  • propertyName: Any property of the data object represented by the point.
  • seriesName: Name of the series that contains the data point (FlexChart only).
  • pointIndex: Index of the data point.
  • value: Value of the data point (y-value for FlexChart, item value for FlexPie).
  • x: x-value of the data point (FlexChart only).
  • y: y-value of the data point (FlexChart only).
  • name: Name of the data point (x-value for FlexChart or legend entry for FlexPie).

Parameters must be enclosed in single curly brackets. For example:

// 'country' and 'sales' are properties of the data object.
  chart.tooltip.content = '{country}, sales:{sales}';

The next example shows how to set the tooltip content using a function.

// Set the tooltip content
  chart.tooltip.content = function (ht) {
    return ht.name + ":" + ht.value.toFixed();
  }
Type
any

cssClass

Gets or sets a CSS class name to use when showing the tooltip.

Inherited From
Tooltip
Type
string

gap

Gets or sets the distance between the tooltip and the target element.

The default value for the property is 6 pixels.

Inherited From
Tooltip
Type
number

hideDelay

Gets or sets the delay, in milliseconds, before hiding the tooltip if the mouse remains over the element.

The default value for the property is zero milliseconds, which causes the tip to remain visible until the mouse moves away from the element.

Inherited From
Tooltip
Type
number

isContentHtml

Gets or sets a value that determines whether the tooltip contents should be displayed as plain text or as HTML.

The default value for the property is true.

Inherited From
Tooltip
Type
boolean

isVisible

Gets a value that determines whether the tooltip is currently visible.

Inherited From
Tooltip
Type
boolean

showAtMouse

Gets or sets a value that determines whether the tooltip should be positioned with respect to the mouse position rather than the target element.

The default value for the property is false.

Inherited From
Tooltip
Type
boolean

showDelay

Gets or sets the delay, in milliseconds, before showing the tooltip after the mouse enters the target element.

The default value for the property is 500 milliseconds.

Inherited From
Tooltip
Type
number

threshold

Gets or sets the maximum distance from the element to display the tooltip.

Type
number

Methods

dispose

dispose(): void

Removes all tooltips associated with this Tooltip instance.

Inherited From
Tooltip
Returns
void

getTooltip

getTooltip(element: any): string

Gets the tooltip content associated with a given element.

Parameters
  • element: any

    Element, element ID, or control that the tooltip explains.

Inherited From
Tooltip
Returns
string

hide

hide(): void

Hides the tooltip if it is currently visible.

Inherited From
Tooltip
Returns
void

onPopup

onPopup(e: TooltipEventArgs): boolean

Raises the popup event.

Parameters
Inherited From
Tooltip
Returns
boolean

setTooltip

setTooltip(element: any, content: string): void

Assigns tooltip content to a given element on the page.

The same tooltip may be used to display information for any number of elements on the page. To remove the tooltip from an element, call setTooltip and specify null for the content.

To remove the tooltips for all elements, call the dispose method.

Parameters
  • element: any

    Element, element ID, or control that the tooltip explains.

  • content: string

    Tooltip content or ID of the element that contains the tooltip content.

Inherited From
Tooltip
Returns
void

show

show(element: any, content: string, bounds?: Rect): void

Shows the tooltip with the specified content, next to the specified element.

Parameters
  • element: any

    Element, element ID, or control that the tooltip explains.

  • content: string

    Tooltip content or ID of the element that contains the tooltip content.

  • bounds: Rect
Optional

Optional element that defines the bounds of the area that the tooltip targets. If not provided, the bounds of the element are used (as reported by the getBoundingClientRect method).

Inherited From
Tooltip
Returns
void

Events