diff --git a/frontend/src/App.css b/frontend/src/App.css index 83517f3..939b630 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -1000,6 +1000,27 @@ html.theme-blue { user-select: none; } +/* 크로스헤어 세로선 — 캔들 pane 하단 시간축 교차 시각 */ +.candle-pane-time-axis__crosshair { + position: absolute; + z-index: 13; + display: none; + align-items: center; + justify-content: center; + transform: translateX(-50%); + padding: 1px 6px; + border-radius: 2px; + font-size: 11px; + line-height: 16px; + font-weight: 500; + color: #fff; + background: #50535e; + white-space: nowrap; + pointer-events: none; + user-select: none; + box-sizing: border-box; +} + /* Loading overlay */ /* 과거 데이터 추가 로드 중 표시 (차트 좌상단 소형 배지) */ .chart-history-loading { diff --git a/frontend/src/components/CandlePaneTimeAxis.tsx b/frontend/src/components/CandlePaneTimeAxis.tsx index be1525b..12fd5a8 100644 --- a/frontend/src/components/CandlePaneTimeAxis.tsx +++ b/frontend/src/components/CandlePaneTimeAxis.tsx @@ -1,10 +1,9 @@ /** * 캔들 pane 하단 시간축 — 거래량·보조지표가 아래에 있을 때 캔들 영역 바로 아래에도 시간 표시. - * - * 드래그 패닝 중에는 라벨 좌표를 재계산하지 않고 translate3d 로 차트와 동일 픽셀만큼 이동한다. - * (setVisibleLogicalRange 직후 LWC 좌표 API가 한 프레임 늦게 갱신되는 문제 회피) + * 크로스헤어 세로선 위치에 해당 날짜·시간 배지를 함께 표시한다. */ import React, { useEffect, useCallback, useRef } from 'react'; +import type { MouseEventParams, Time } from 'lightweight-charts'; import type { ChartManager } from '../utils/ChartManager'; import { subscribeChartTimeFormat } from '../utils/chartTimeFormat'; @@ -44,8 +43,36 @@ function applyOverlayLayout( const CandlePaneTimeAxis: React.FC = ({ manager, containerEl }) => { const axisRef = useRef(null); + const crosshairRef = useRef(null); const labelPoolRef = useRef([]); + const updateCrosshairLabel = useCallback((p: MouseEventParams