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.forceDateRange(tooltip.axisTimeCombinations.HOUR_DAY)
Methods
-
module:Tooltip(_selection, _data)
-
This function creates the graph using the selection as container
Parameters:
Name Type Description _selectionD3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered _dataObject The data to attach and generate the chart - Source:
-
<static> dateLabel(_x)
-
Gets or Sets the dateLabel of the data
Parameters:
Name Type Description _xNumber Desired dateLabel - Source:
Returns:
Current dateLabel or Chart module to chain calls- Type
- dateLabel | module
-
<static> forceDateRange(_x)
-
Exposes the ability to force the tooltip to use a certain date format
Parameters:
Name Type Description _xString Desired format - Source:
Returns:
Current format or module to chain calls- Type
- String | Module
-
<static> forceOrder(_x)
-
Pass an override for the ordering of your tooltip
Parameters:
Name Type Description _xArray.<Object> Array of the names of your tooltip items - Source:
Returns:
Current overrideOrder or Chart module to chain calls- Type
- overrideOrder | module
-
<static> hide()
-
Hides the tooltip
- Source:
Returns:
Tooltip module to chain calls- Type
- 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 _xstring 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 _xNumber Desired topicLabel - Source:
Returns:
Current topicLabel or Chart module to chain calls- Type
- topicLabel | module
-
<static> update(dataPoint, colorMapping, position)
-
Updates the position and content of the tooltip
Parameters:
Name Type Description dataPointObject Datapoint to represent colorMappingObject Color scheme of the topics positionNumber X-scale position in pixels - Source:
Returns:
Tooltip module to chain calls- Type
- Module
-
<static> valueLabel(_x)
-
Gets or Sets the valueLabel of the data
Parameters:
Name Type Description _xNumber Desired valueLabel - Source:
Returns:
Current valueLabel or Chart module to chain calls- Type
- valueLabel | module