디자인킷 · 반폭
반폭 · 워터폴(시작, 증감 3개, 결과)
D-반폭-워터폴5막대
언제 쓰는가
[값을 넣으려면 D-반폭-워터폴5막대-값자리] 시작 값에서 요인별 증가와 감소를 거쳐 결과 값에 이르는 과정을 절반 칸에. 막대 5개 고정(시작 1, 증감 3, 결과 1). 막대 이름 5자 이내, 값은 지수나 건수. 결과 막대만 강조색. 증감이 4개 이상이면 전폭 워터폴 사용. 값 바꾸는 법: 막대 5개(왼쪽부터 시작, 증감 3, 결과). 1단위 = 0.9px, 바닥 y = 160. 시작과 결과 막대: y = 160 − 값 × 0.9, height = 값 × 0.9. 증가 막대: y = 160 − (직전 누계 + 증가분) × 0.9, height = 증가분 × 0.9. 감소 막대: y = 160 − 직전 누계 × 0.9, height = 감소분 × 0.9, class="f-dn". 값 글자 y = 막대 y − 6. 막대 사이 점선(.cn)의 y = 160 − 그 시점 누계 × 0.9. 가장 큰 누계가 150 을 넘으면 0.9 를 줄여 다시 계산.
참고
직접 제작. 외부 URL 참조 없음. 워터폴 차트의 일반 구성(시작과 결과는 바닥에서, 증감은 직전 누계에서 이어 그리고 점선으로 잇기)을 참고. 감소는 색 대신 점선 테두리로 구분.
조각
<div class="dk dkh dkh-c-wfall"><div class="dk-card"><p class="dk-lb">분기 전환 지수 변화 요인 · 지난 분기 = 100</p> <div class="cv"><svg width="100%" viewBox="0 0 400 186" preserveAspectRatio="xMidYMid meet" role="img"> <line x1="0" y1="160.5" x2="400" y2="160.5" class="ax"/> <rect x="16" y="70" width="48" height="90" rx="2" class="f-g2"/><text x="40" y="64" text-anchor="middle" class="v">100</text><text x="40" y="178" text-anchor="middle" class="k">지난 분기</text><line x1="64" y1="70" x2="96" y2="70" class="cn"/> <rect x="96" y="44.8" width="48" height="25.2" rx="2" class="f-g4"/><text x="120" y="38.8" text-anchor="middle" class="v">+28</text><text x="120" y="178" text-anchor="middle" class="k">검색어 확장</text><line x1="144" y1="44.8" x2="176" y2="44.8" class="cn"/> <rect x="176" y="30.4" width="48" height="14.4" rx="2" class="f-g4"/><text x="200" y="24.4" text-anchor="middle" class="v">+16</text><text x="200" y="178" text-anchor="middle" class="k">소재 교체</text><line x1="224" y1="30.4" x2="256" y2="30.4" class="cn"/> <rect x="256" y="30.4" width="48" height="10.8" rx="2" class="f-dn"/><text x="280" y="24.4" text-anchor="middle" class="v">−12</text><text x="280" y="178" text-anchor="middle" class="k">예산 이동</text><line x1="304" y1="41.2" x2="336" y2="41.2" class="cn"/> <rect x="336" y="41.2" width="48" height="118.8" rx="2" class="f-a"/><text x="360" y="35.2" text-anchor="middle" class="va t14">132</text><text x="360" y="178" text-anchor="middle" class="k">이번 분기</text> </svg></div> <p class="lg"><span><i class="c-g4"></i>증가</span><span><i class="c-dn"></i>감소</span><span><i class="c-a"></i>결과</span></p> <p class="nt">예시 값 · 지수는 지난 분기 = 100 기준</p></div></div>
스타일
.dkh-c-wfall .dk-card{display:flex;flex-direction:column;padding:20px 26px 18px}
.dkh-c-wfall .dk-lb{flex:none;margin:0 0 10px}
.dkh-c-wfall .nt{flex:none;margin:8px 0 0;font-size:var(--f-cap);color:var(--mu);line-height:1.4}
.dkh-c-wfall .cv{flex:1;min-height:0;position:relative}
.dkh-c-wfall .cv svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.dkh-c-wfall svg text{font-family:inherit;font-size:13px;fill:var(--mu);font-variant-numeric:tabular-nums}
.dkh-c-wfall svg .k{fill:var(--ink2)}
.dkh-c-wfall svg .v{fill:var(--ink);font-weight:600}
.dkh-c-wfall svg .va{fill:var(--ac);font-weight:700}
.dkh-c-wfall svg .on{fill:var(--card);font-weight:600}
.dkh-c-wfall svg .t14{font-size:14px}
.dkh-c-wfall svg .f-a{fill:var(--ac)}
.dkh-c-wfall svg .f-g2{fill:var(--g2)}
.dkh-c-wfall svg .f-g4{fill:var(--g4)}
.dkh-c-wfall svg .f-dn{fill:var(--card);stroke:var(--g3);stroke-width:1.5;stroke-dasharray:4 3}
.dkh-c-wfall svg .ax{stroke:var(--line2);stroke-width:1}
.dkh-c-wfall svg .cn{stroke:var(--g3);stroke-width:1;stroke-dasharray:2 3}
.dkh-c-wfall .lg{flex:none;display:flex;flex-wrap:wrap;gap:4px 16px;font-size:var(--f-cap);line-height:1.4;color:var(--ink2);margin:8px 0 0}
.dkh-c-wfall .lg span{display:flex;align-items:center;gap:6px}
.dkh-c-wfall .lg i{display:block;width:12px;height:12px;border-radius:2px}
.dkh-c-wfall .lg .c-a{background:var(--ac)}
.dkh-c-wfall .lg .c-g4{background:var(--g4)}
.dkh-c-wfall .lg .c-dn{background:var(--card);box-shadow:inset 0 0 0 1px var(--g3)}