보조지표 전체보기 후 복귀버튼 추가
This commit is contained in:
@@ -56,6 +56,7 @@ import ChartHoverToolbar from './ChartHoverToolbar';
|
||||
import ChartMagnifier from './ChartMagnifier';
|
||||
import ChartContextMenu from './ChartContextMenu';
|
||||
import CandlePaneControls from './CandlePaneControls';
|
||||
import IndicatorPaneControls from './IndicatorPaneControls';
|
||||
import { getKoreanName } from '../utils/marketNameCache';
|
||||
import { DEFAULT_DISPLAY_TIMEZONE } from '../utils/timezone';
|
||||
import { chartHasStaleIndicators, classifyIndicatorChartChange, singleIndParamKey } from '../utils/indicatorChartSync';
|
||||
@@ -1667,6 +1668,15 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
||||
onRestore={() => setCandleOnlyMode(false)}
|
||||
/>
|
||||
)}
|
||||
{chartMgr && focusedIndicatorId && onRestoreIndicators && chartPaintReady && (
|
||||
<IndicatorPaneControlsPortal
|
||||
manager={chartMgr}
|
||||
indicators={indicators}
|
||||
getContainer={() => containerRef.current}
|
||||
focusedId={focusedIndicatorId}
|
||||
onRestore={onRestoreIndicators}
|
||||
/>
|
||||
)}
|
||||
{chartMgr && !candleOnlyMode && showPaneLegend && chartPaintReady && (
|
||||
<PaneLegendPortal
|
||||
key={indKey(indicators)}
|
||||
@@ -1723,6 +1733,33 @@ const CandlePaneTimeAxisPortal: React.FC<{
|
||||
return <CandlePaneTimeAxis manager={manager} containerEl={el} />;
|
||||
};
|
||||
|
||||
const IndicatorPaneControlsPortal: React.FC<{
|
||||
manager: ChartManager;
|
||||
indicators: IndicatorConfig[];
|
||||
getContainer: () => HTMLElement | null;
|
||||
focusedId: string;
|
||||
onRestore: () => void;
|
||||
}> = ({ manager, indicators, getContainer, focusedId, onRestore }) => {
|
||||
const [el, setEl] = useState<HTMLElement | null>(null);
|
||||
useEffect(() => {
|
||||
const c = getContainer();
|
||||
if (c) { setEl(c); return; }
|
||||
const tid = setTimeout(() => setEl(getContainer()), 100);
|
||||
return () => clearTimeout(tid);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
if (!el) return null;
|
||||
return (
|
||||
<IndicatorPaneControls
|
||||
manager={manager}
|
||||
containerEl={el}
|
||||
indicators={indicators}
|
||||
focusedId={focusedId}
|
||||
onRestore={onRestore}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const CandlePaneControlsPortal: React.FC<{
|
||||
manager: ChartManager;
|
||||
getContainer: () => HTMLElement | null;
|
||||
|
||||
Reference in New Issue
Block a user