Mini Tooltip Component reusable API class that renders a
simple and configurable tooltip element for Britechart's
bar and step chart.
(require("Mini-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 |
Array | The data to attach and generate the chart (usually an empty array) |
- Source:
Requires
- module:d3
Methods
-
module:Mini-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 _dataArray The data to attach and generate the chart (usually an empty array) - Source:
-
<static> hide()
-
Hides the tooltip
- Source:
Returns:
Tooltip module to chain calls- Type
- Module
-
<static> nameLabel(_x)
-
Gets or Sets data's nameLabel
Parameters:
Name Type Description _xtext Desired nameLabel - Source:
Returns:
nameLabel or Step Chart module to chain calls- Type
- text | 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> update(dataPoint, mousePosition, chartSize)
-
Updates the position and content of the tooltip
Parameters:
Name Type Description dataPointObject Datapoint of the hovered element mousePositionArray Mouse position relative to the parent chart [x, y] chartSizeArray Parent chart size [x, y] - Source:
Returns:
Current component- Type
- module