실시간 차트 스크롤시 날짜 동기화 문제
This commit is contained in:
@@ -78,6 +78,8 @@ export interface PaneLegendProps {
|
||||
focusedId?: string | null;
|
||||
/** 전체화면 → 전체 보기 복원 */
|
||||
onRestore?: () => void;
|
||||
/** 크로스헤어 이동 시 보조지표 수치 표시 */
|
||||
crosshairInfoVisible?: boolean;
|
||||
}
|
||||
|
||||
// ── 지그재그 배경색 — 홀짝 2단계로만 번갈아 적용 ───────────────────────────
|
||||
@@ -328,6 +330,7 @@ const PaneLegend: React.FC<PaneLegendProps> = ({
|
||||
manager, indicators, containerEl, paused = false,
|
||||
onHoverName, onLeaveName, onDoubleClick,
|
||||
onReorder, onMerge, onSplit, onExpand, onRemove, onDuplicate, focusedId, onRestore,
|
||||
crosshairInfoVisible = true,
|
||||
}) => {
|
||||
const [paneItems, setPaneItems] = useState<PaneItem[]>([]);
|
||||
const [paneLayouts, setPaneLayouts] = useState<Array<{ paneIndex: number; topY: number; height: number }>>([]);
|
||||
@@ -426,12 +429,16 @@ const PaneLegend: React.FC<PaneLegendProps> = ({
|
||||
}, [containerEl, refreshLayouts, syncPaneItems]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!crosshairInfoVisible) {
|
||||
setValues({});
|
||||
return;
|
||||
}
|
||||
const unsub = manager.subscribeCrosshair((p: MouseEventParams<Time>) => {
|
||||
if (!p.time) { setValues({}); return; }
|
||||
setValues(manager.getIndicatorValuesByIdFromParams(p));
|
||||
});
|
||||
return unsub;
|
||||
}, [manager]);
|
||||
}, [manager, crosshairInfoVisible]);
|
||||
|
||||
// ── 드롭 라인 Y ────────────────────────────────────────────────────────────
|
||||
const getDropLineY = useCallback((idx: number): number | null => {
|
||||
@@ -697,7 +704,7 @@ const PaneLegend: React.FC<PaneLegendProps> = ({
|
||||
>
|
||||
{item.label}
|
||||
</span>
|
||||
{itemVals.map((v, i) => isNaN(v) ? null : (
|
||||
{crosshairInfoVisible && itemVals.map((v, i) => isNaN(v) ? null : (
|
||||
<span key={i} className="pane-legend-val"
|
||||
style={{ color: item.plotColors[i] ?? 'var(--text)' }}>
|
||||
{formatVal(v)}
|
||||
|
||||
Reference in New Issue
Block a user