auto: 일일 백업 2026-07-24 02:00
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -601,6 +601,10 @@ VOL_BOT = VOL_TOP + VOL_PANEL_H
|
||||
|
||||
CHART_RANGE_DAYS = {'1Y': 250, '6M': 120, '3M': 63, '1M': 21}
|
||||
|
||||
# 사용자 수평선 색상 팔레트 — 정렬(내림차순) 인덱스로 순환. SVG·칩 UI가 같은 매핑 사용.
|
||||
# 모두 밝은 톤이라 태그 위 어두운 글자(#1a0f1f) 가독성 확보.
|
||||
HLINE_COLORS = ['#e879f9', '#38bdf8', '#fbbf24', '#4ade80', '#fb7185', '#a78bfa', '#22d3ee', '#facc15']
|
||||
|
||||
|
||||
def render_svg_chart(snap: dict, range_key: str = '1Y', ref_price: float | None = None,
|
||||
intraday: bool = False, hlines: list | None = None) -> str:
|
||||
@@ -876,22 +880,23 @@ def render_svg_chart(snap: dict, range_key: str = '1Y', ref_price: float | None
|
||||
# ---- 사용자 수평선 (hlines) — 지지/저항 등 수동 등록 가격선 ----
|
||||
# 표시 구간(y_min~y_max) 안에 드는 값만 그린다. 스케일은 확장하지 않음(캔들 가독성 우선).
|
||||
# 좌측에 분홍 가격 태그를 둔다(우측은 가격축·현재가 태그가 이미 점유).
|
||||
for hp in (hlines or []):
|
||||
for _hi, hp in enumerate(hlines or []):
|
||||
try:
|
||||
hp = float(hp)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
if hp < y_min or hp > y_max:
|
||||
continue
|
||||
hcolor = HLINE_COLORS[_hi % len(HLINE_COLORS)]
|
||||
hly = price_y(hp)
|
||||
parts.append(
|
||||
f'<line x1="{CHART_PAD_L}" y1="{hly:.1f}" x2="{CHART_W-CHART_PAD_R}" y2="{hly:.1f}" '
|
||||
f'stroke="#e879f9" stroke-width="1.6" stroke-dasharray="6 4" opacity="0.9"/>'
|
||||
f'stroke="{hcolor}" stroke-width="1.6" stroke-dasharray="6 4" opacity="0.9"/>'
|
||||
)
|
||||
htag_y = min(max(hly, PRICE_TOP + 15), PRICE_BOT - 15)
|
||||
parts.append(
|
||||
f'<rect x="{CHART_PAD_L+2}" y="{htag_y-15:.1f}" width="122" height="30" '
|
||||
f'fill="#e879f9" rx="3" opacity="0.95"/>'
|
||||
f'fill="{hcolor}" rx="3" opacity="0.95"/>'
|
||||
)
|
||||
parts.append(
|
||||
f'<text x="{CHART_PAD_L+8}" y="{htag_y+8:.1f}" text-anchor="start" fill="#1a0f1f" '
|
||||
|
||||
Reference in New Issue
Block a user