CrosshairConfig
type CrosshairConfig = {
badgeColor?: VroomColor;
button?: CrosshairButtonConfig;
hour12?: boolean;
lineStyle?: CrosshairLineStyle;
lineWidth?: number;
mode?: CrosshairMode;
offset?: number;
simple?: {
dimAhead?: boolean;
dimOpacity?: number;
height?: number;
};
timeFormat?: CrosshairTimeFormat;
};
Source: types/src/index.ts:1220
Crosshair behavior and look. Every field is optional; colors come from the
theme (crosshair for the lines, crosshairTarget for the ring and badge
fill, badgeText for badge text) unless badgeColor sets the badge fill.
Properties
badgeColor?
optional badgeColor?: VroomColor;
Source: types/src/index.ts:1236
Fill of the crosshair's time and price badges, the plus button and the
simple-mode badge. Defaults to theme.crosshairTarget, which also colors
the ring; this leaves the ring alone. Text stays theme.badgeText.
button?
optional button?: CrosshairButtonConfig;
Source: types/src/index.ts:1243
The plus button (advanced mode only). Replaces crosshairButton.
hour12?
optional hour12?: boolean;
Source: types/src/index.ts:1230
12-hour clock with AM/PM (11:30 AM). Default false.
lineStyle?
optional lineStyle?: CrosshairLineStyle;
Source: types/src/index.ts:1224
Default 'dashed' in advanced mode, 'solid' in simple mode.
lineWidth?
optional lineWidth?: number;
Source: types/src/index.ts:1226
Line stroke in px. Default 1. Dash and dot spacing scale with it.
mode?
optional mode?: CrosshairMode;
Source: types/src/index.ts:1222
Default 'advanced'. See CrosshairMode.
offset?
optional offset?: number;
Source: types/src/index.ts:1241
Pixels the touch crosshair's dot and horizontal line sit above the finger
(advanced mode). Default 40. Replaces crosshairOffset.
simple?
optional simple?: {
dimAhead?: boolean;
dimOpacity?: number;
height?: number;
};
Source: types/src/index.ts:1245
Simple-mode options.
dimAhead?
optional dimAhead?: boolean;
Dim everything right of the line, the scrub highlight. Default true.
dimOpacity?
optional dimOpacity?: number;
Opacity of what dimAhead dims, 0 to 1. Default 0.35.
height?
optional height?: number;
Where the badge's top sits, as a fraction of the chart's height: 1 is the top, 0 the bottom. Default 1. The badge always stays fully on screen, and the line runs from under it down to the bottom of the plot.
timeFormat?
optional timeFormat?: CrosshairTimeFormat;
Source: types/src/index.ts:1228
Default 'datetime' in advanced mode, 'time' in simple mode.