API: Tooltip

Tooltip Component reusable API class that renders a simple and configurable tooltip element for Britechart's line chart or stacked area chart.

(require("Tooltip"))(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data Object The data to attach and generate the chart
Source:

Requires

  • module:d3-array,

Members


<static> axisTimeCombinations

constants to be used to force the x axis to respect a certain granularity current options: HOUR_DAY, DAY_MONTH, MONTH_YEAR
Source:
Example
tooltip.dateFormat(tooltip.axisTimeCombinations.HOUR_DAY)

Methods


module:Tooltip(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data Object The data to attach and generate the chart
Source:

<static> dateFormat(_x)

Exposes the ability to force the tooltip to use a certain date format
Parameters:
Name Type Description
_x String Desired format
Source:
Returns:
Current format or module to chain calls
Type
String | Module

<static> dateLabel(_x)

Gets or Sets the dateLabel of the data
Parameters:
Name Type Description
_x Number Desired dateLabel
Source:
Returns:
Current dateLabel or Chart module to chain calls
Type
dateLabel | module

<static> hide()

Hides the tooltip
Source:
Returns:
Tooltip module to chain calls
Type
Module

<static> locale(_x)

Pass locale for the tooltip to render the date in
Parameters:
Name Type Description
_x String must be a locale tag like 'en-US' or 'fr-FR'
Source:
Returns:
Current locale or module to chain calls
Type
String | Module

<static> nameLabel(_x)

Gets or Sets the nameLabel of the data
Parameters:
Name Type Description
_x Number Desired nameLabel
Source:
Returns:
Current nameLabel or Chart module to chain calls
Type
nameLabel | module

<static> shouldShowDateInTitle(_x)

Gets or Sets shouldShowDateInTitle
Parameters:
Name Type Description
_x Boolean Desired value
Source:
Returns:
Current shouldShowDateInTitle or Chart module to chain calls
Type
shouldShowDateInTitle | module

<static> show()

Shows the tooltip
Source:
Returns:
Tooltip module to chain calls
Type
Module

<static> title(_x)

Gets or Sets the title of the tooltip
Parameters:
Name Type Description
_x string Desired title
Source:
Returns:
Current title or module to chain calls
Type
string | module

<static> topicLabel(_x)

Gets or Sets the topicLabel of the data
Parameters:
Name Type Description
_x Number Desired topicLabel
Source:
Returns:
Current topicLabel or Chart module to chain calls
Type
topicLabel | module

<static> topicsOrder(_x)

Pass an override for the ordering of your tooltip
Parameters:
Name Type Description
_x Array.<Object> Array of the names of your tooltip items
Source:
Returns:
Current overrideOrder or Chart module to chain calls
Type
overrideOrder | module

<static> update(dataPoint, colorMapping, position)

Updates the position and content of the tooltip
Parameters:
Name Type Description
dataPoint Object Datapoint to represent
colorMapping Object Color scheme of the topics
position Number X-scale position in pixels
Source:
Returns:
Tooltip module to chain calls
Type
Module

<static> valueFormat(_x)

Gets or Sets the valueFormat of the tooltip
Parameters:
Name Type Description
_x String Desired valueFormat
Source:
Returns:
Current valueFormat or module to chain calls
Type
String | module

<static> valueLabel(_x)

Gets or Sets the valueLabel of the data
Parameters:
Name Type Description
_x Number Desired valueLabel
Source:
Returns:
Current valueLabel or Chart module to chain calls
Type
valueLabel | module