Class: HeadsUp

HeadsUp

A heads-up instance. This is a plugin that responds to interaction State and displays numerical chart data in an area on the chart. The area will display the price of every plot on the chart as of either the current date, or the date of the bar the cursor is hovering over. The heads-up values are displayed when either the crosshair is on or the heads-up is toggled on in the chart layout. HeadsUp is a plugin. To use it, you must add "headsUp" to the InteractionConfig plugins array.

Since:
  • 9.4.0 Introduced
  • 10.1.0 Added formatting using yAxis.formatter

Type Definitions


HeadsUpConfig

Configures the display of numerical chart data in an area on the chart. The heads-up values are displayed when either the crosshair is on or the heads-up is toggled on in the chart layout.

Type:
Properties:
Name Type Argument Description
export string <optional>

Name of the exported class, usually "HeadsUp".

offDelay string <optional>

Set to allow delay in transitioning heads-up off after release of long-press. e.g., "5s".

titleOnly boolean <optional>

Set to true to only display the plot names.

displayMapping Record.<string, (Record.<string, string>|undefined)> <optional>

Allows specification of custom labels to display in the heads-up area in lieu of the standard field names. Using the key global allows the value mapping to apply to all plots. Using a key matching a plot name restricts the mapping to that plot name. You can use handlebars ({{xxx}}) to reference a study input. See example for details.

backgroundColor string <optional>

Color of backing behind the heads-up area.

Since:
  • 9.4.0 Introduced
  • 10.1.0 Added property titleOnly.
Example

Use handlebars to reference a study name in a `displayMapping`:

displayMapping: {
	...
 // instead of showing "ma 1", "ma 2", "ma 3" in the heads-up, now it will show "ma 10", "ma 50", "ma 200" (assuming these 3 values are the maCross input values).
	maCross: {
		"ma 1": "ma\u200c{{MA 1 Period}}",
		"ma 2": "ma\u200c{{MA 2 Period}}",
		"ma 3": "ma\u200c{{MA 3 Period}}"
	}
}