Skip to content

Crosshair

Customize the crosshair lines that follow your cursor.

← Back to Custom Styles overview

Copy the property path into your setCustomStyles config. You only need to include the values you want to change.

PropertyDescriptionTypeExample
crosshair.showShow or hide the crosshairbooleantrue
crosshair.horizontal.showShow horizontal crosshairbooleantrue
crosshair.horizontal.line.showShow horizontal linebooleantrue
crosshair.horizontal.line.colorColor of horizontal linecolor'#76808F'
crosshair.horizontal.line.styleStyle of horizontal line'dashed' | 'solid''dashed'
crosshair.horizontal.line.sizeThickness of horizontal linenumber1
crosshair.horizontal.text.showShow price label on horizontal linebooleantrue
crosshair.horizontal.text.colorText color of price labelcolor'#FFFFFF'
crosshair.horizontal.text.backgroundColorBackground of price labelcolor'#76808F'
crosshair.horizontal.text.sizeFont size of price labelnumber12
crosshair.vertical.showShow vertical crosshairbooleantrue
crosshair.vertical.line.showShow vertical linebooleantrue
crosshair.vertical.line.colorColor of vertical linecolor'#76808F'
crosshair.vertical.line.styleStyle of vertical line'dashed' | 'solid''dashed'
crosshair.vertical.text.showShow time label on vertical linebooleantrue
crosshair.vertical.text.colorText color of time labelcolor'#FFFFFF'
crosshair.vertical.text.backgroundColorBackground of time labelcolor'#76808F'

Example

typescript
chart.setCustomStyles({
  global: {
    crosshair: {
      horizontal: {
        line: { style: 'dashed', color: '#888888' },
      },
      vertical: {
        line: { style: 'dashed', color: '#888888' },
      },
    },
  },
})

Developers who need full TypeScript interfaces can use the type reference.