Exciting Update: Version 1.0.1 is now available, introducing high-performance technical indicators and custom drawing tools. Read more
Version: 1.0.0

Custom crosshair

The CustomCrosshair module exposes the crosshair appearance settings — line color, width, dash pattern, and coordinate badge styling — via the ChartingAPI.

Overview

Edit custom-crosshair.js to call window.ChartingAPI.setCrosshairSettings(). Leave color fields empty to use automatic theme-aware colors.

Settings API

window.ChartingAPI.setCrosshairSettings({
  color: 'rgba(239, 83, 80, 0.4)', // Crosshair line color
  width: 0.8, // Line thickness in pixels
  dashArray: [3, 3], // Dash pattern [dash, gap]
  showPriceBadge: true, // Toggle Y-axis price badge
  showTimeBadge: true, // Toggle X-axis time badge
  badgeBgColor: '#2962ff', // Badge background color
  badgeTextColor: '#ffffff' // Badge text color
});

Options Reference

OptionTypeDescription
colorstringCrosshair line color. Leave empty for auto theme colors.
widthnumberLine thickness in pixels (e.g. 0.8).
dashArraynumber[]Dash/gap pattern, e.g. [3, 3].
showPriceBadgebooleanToggle Y-axis price coordinate badge.
showTimeBadgebooleanToggle X-axis time coordinate badge.
badgeBgColorstringBackground color for coordinate badges.
badgeTextColorstringText color inside coordinate badges.