Skip to content

ValueMarkerConfig

A value marker displays a horizontal line and/or label at a specific value on the y-axis, typically used to highlight the last visible or last known data point.

Example

ts
{
  mode: 'last-visible',
  line: { color: '#1a1a1a', width: 1, style: 'dashed' },
  label: { backgroundColor: 'white', borderColor: '#1a1a1a' }
}

Properties

mode

Determines which data point the marker tracks.

line

Configuration for the marker's horizontal line. Set to false to hide the line, or provide a LineConfig object for custom styling.

label

Configuration for the marker's value label. Set to false to hide the label, or provide a BoxedValueLabelConfig object for custom styling.


TypeScript

ts
type ValueMarkerMode = 'last-visible' | 'last-data';

interface ValueMarkerConfig {
  mode?: ValueMarkerMode;
  line?: false | LineConfig;
  label?: false | BoxedValueLabelConfig;
}

React Candlesticks is available on npm and GitHub under the MIT License.