실시간 차트 오류 수정

This commit is contained in:
Macbook
2026-05-25 04:18:30 +09:00
parent ac2e6a1dae
commit 0cfe7fc84c
3 changed files with 96 additions and 27 deletions
+15 -8
View File
@@ -356,16 +356,19 @@ export class ChartManager {
this._reapplyAllPatternMarkers();
// 이전 timeScale visible range를 완전히 리셋 후 fitContent
// setVisibleRange → 이전 zoom 상태를 무시하고 새 데이터 범위로 명시 초기화
// 이전 timeScale visible range를 완전히 리셋
const ts = this.chart.timeScale();
if (bars.length >= 2) {
ts.setVisibleRange({
from: bars[0].time as Time,
to: bars[bars.length - 1].time as Time,
});
if (bars.length < 20) {
ts.setVisibleLogicalRange({ from: bars.length - 200, to: bars.length + 5 });
} else {
ts.setVisibleRange({
from: bars[0].time as Time,
to: bars[bars.length - 1].time as Time,
});
ts.fitContent();
}
}
ts.fitContent();
}
private _createMainSeries(chartType: ChartType, t: ThemeTokens): ISeriesApi<SeriesType> {
@@ -2389,7 +2392,11 @@ export class ChartManager {
const ts = this.chart.timeScale();
if (bars.length <= displayCount && extendFutureBars === 0) {
ts.fitContent();
if (bars.length < 20) {
ts.setVisibleLogicalRange({ from: bars.length - displayCount, to: bars.length + 5 });
} else {
ts.fitContent();
}
return;
}