Pins

live example

Explore the API in the live example.

api reference

Pins()
Component implementing the pins feature. A pins is a vertical line with a circle on the top and an optional text label as description. When this component is available for a widget, its API is exposed via the .pins namespace.
Pins.add(id, position[, options[, duration]])
Adds a pins to the chart. If the pon ID already exists, no action is taken.

Parameters

NameTypeDescription
idstringUnique identifier of the pins.
positionnumberValue to add pins to.
optionsObjectoptionalPin design options. Supported values:
  • string color: Pin color. Default value is the current font color.
  • number size: Size of the pins head in pixels. Default value is 6.
  • number height: Pin height relative to the Y range. Default value is 0.8.
  • string text: Label to add to the pins. The label is visible when hovering over the pins. Default value is an empty string.
  • boolean fixed: Whether to fix the pin label to be shown all the time. Default value is false.
 Default value is {}.
durationnumberoptionalDuration of the animation of adding the pins. Default value is 0.

Returns

Widget
Reference to the Widget's API.
Pins.remove([id[, duration]])
Removes one or all pins from the chart.

Parameters

NameTypeDescription
idstringoptionalIdentifier of the pins to remove. If pins with the specified identifier does not exist, no change is applied. If it is not specified, all pins are removed from the current chart. Default value is undefined.
durationnumberoptionalDuration of the remove animation. Default value is 0.

Returns

Widget
Reference to the Widget's API.