커스텀 수정
This commit is contained in:
@@ -71,6 +71,7 @@ import {
|
||||
type ChartCustomOverlaySlotId,
|
||||
createDefaultChartCustomOverlaySelection,
|
||||
isCustomIchimokuCloudVisible,
|
||||
isCustomOverlayPlotControlledType,
|
||||
isCustomPlotSelected,
|
||||
} from './chartCustomOverlay';
|
||||
import type { PlotDef, HLineStyle } from './indicatorRegistry';
|
||||
@@ -1372,12 +1373,14 @@ export class ChartManager {
|
||||
}
|
||||
|
||||
const showPriceLabel = this.shouldShowSeriesPriceLabel(_config, info.lastVal, pane);
|
||||
const lineVisible = this._resolveSeriesVisible(_config, info.id);
|
||||
const series = this.chart.addSeries(LineSeries, {
|
||||
color: info.color,
|
||||
lineWidth: 1,
|
||||
priceLineVisible: false,
|
||||
lastValueVisible: showPriceLabel,
|
||||
title: showPriceLabel ? info.title : '',
|
||||
lastValueVisible: showPriceLabel && lineVisible,
|
||||
title: showPriceLabel && lineVisible ? info.title : '',
|
||||
visible: lineVisible,
|
||||
}, pane);
|
||||
series.setData(seriesData);
|
||||
seriesList.push(series);
|
||||
@@ -2435,9 +2438,13 @@ export class ChartManager {
|
||||
|
||||
/** 사용자 hidden + 세션 오버레이 토글 — entry.config.hidden 은 사용자 의도만 반영 */
|
||||
private _isIndicatorEffectivelyVisible(config: IndicatorConfig): boolean {
|
||||
if (config.hidden === true) return false;
|
||||
if (this._isCustomOverlayApplied() && isCustomOverlayPlotControlledType(config.type)) {
|
||||
return true;
|
||||
}
|
||||
const overlayKey = chartOverlayKeyForType(config.type);
|
||||
if (overlayKey && !this._chartOverlayVisibility[overlayKey]) return false;
|
||||
return config.hidden !== true;
|
||||
return true;
|
||||
}
|
||||
|
||||
getChartCustomOverlayActive(slot: ChartCustomOverlaySlotId = 'custom'): boolean {
|
||||
@@ -2458,14 +2465,15 @@ export class ChartManager {
|
||||
selection: ChartCustomOverlaySelection,
|
||||
slot: ChartCustomOverlaySlotId = 'custom',
|
||||
): void {
|
||||
const defaults = createDefaultChartCustomOverlaySelection();
|
||||
this._customOverlaySlots[slot].selection = {
|
||||
smaPlots: { ...selection.smaPlots },
|
||||
bollinger: { ...selection.bollinger },
|
||||
ichimoku: { ...selection.ichimoku },
|
||||
smaPlots: { ...defaults.smaPlots, ...selection.smaPlots },
|
||||
bollinger: { ...defaults.bollinger, ...selection.bollinger },
|
||||
ichimoku: { ...defaults.ichimoku, ...selection.ichimoku },
|
||||
candle: selection.candle,
|
||||
};
|
||||
if (this._customOverlaySlots[slot].active) {
|
||||
this.syncChartOverlayVisibility();
|
||||
this._syncCustomOverlayVisibilityToChart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2477,7 +2485,18 @@ export class ChartManager {
|
||||
const other: ChartCustomOverlaySlotId = slot === 'custom' ? 'custom1' : 'custom';
|
||||
this._customOverlaySlots[other].active = false;
|
||||
}
|
||||
this._syncCustomOverlayVisibilityToChart();
|
||||
}
|
||||
|
||||
/** Custom 적용 중 — plot·캔들·구름 가시성을 선택값과 동기화 */
|
||||
private _syncCustomOverlayVisibilityToChart(): void {
|
||||
this.syncChartOverlayVisibility();
|
||||
if (!this._isCustomOverlayApplied()) return;
|
||||
for (const entry of this.indicators.values()) {
|
||||
const config = entry.config;
|
||||
if (!config || !isCustomOverlayPlotControlledType(config.type)) continue;
|
||||
this.applyIndicatorStyle(config);
|
||||
}
|
||||
}
|
||||
|
||||
/** custom 미적용 시 지표 설정 plotVisibility, 적용 시 custom 선택만 반영 */
|
||||
@@ -2496,9 +2515,11 @@ export class ChartManager {
|
||||
}
|
||||
|
||||
private _resolveCandleVisible(): boolean {
|
||||
if (this._isCustomOverlayApplied()) {
|
||||
return this._getAppliedCustomOverlaySelection().candle;
|
||||
}
|
||||
if (!this._chartOverlayVisibility.candle) return false;
|
||||
if (!this._isCustomOverlayApplied()) return true;
|
||||
return this._getAppliedCustomOverlaySelection().candle;
|
||||
return true;
|
||||
}
|
||||
|
||||
private _shouldShowBbBandFillForConfig(config: IndicatorConfig): boolean {
|
||||
|
||||
Reference in New Issue
Block a user