디자인킷 · 반폭
반폭 · 2계열 라인(우리와 비교 대상)
D-반폭-라인2계열
언제 쓰는가
우리와 비교 대상(업종 평균, 지난해, 경쟁) 두 흐름의 격차를 절반 칸에. 시점 6~10개. 계열 이름은 선 끝에 직접 적고 범례는 두지 않음. 계열 이름 5자 이내. 값 바꾸는 법: 점 x = 36 + (300 ÷ (시점 수 − 1)) × (순번 − 1), y = 196 − (값 − 축 최솟값) ÷ (축 최댓값 − 축 최솟값) × 176(예시 축 90~150). 우리 계열 polyline class="ln hot", 비교 계열 class="ln sub". 선 끝 글자 x = 348, 큰 값 y = 끝점 y + 2, 이름 y = 끝점 y + 19. 두 끝점의 y 차이가 44 미만이면 위 라벨을 위로, 아래 라벨을 아래로 밀어 겹치지 않게 배치.
참고
Storytelling with Data(https://www.storytellingwithdata.com)의 비교 대상을 회색으로 낮추고 선 끝에 이름을 적는 방식, Financial Times Visual Vocabulary(https://github.com/Financial-Times/chart-doctor/tree/main/visual-vocabulary)의 Change over Time 분류를 참고. 직접 제작.
조각
<div class="dk dkh dkh-g-line2"><div class="dk-card"><p class="dk-lb">주차별 계정 도달 지수 · 집행 첫 주 100 기준</p> <div class="cv"><svg width="100%" viewBox="0 0 400 224" preserveAspectRatio="xMidYMid meet" role="img"> <line x1="36" y1="196" x2="336" y2="196" class="ax"/><text x="28" y="200" text-anchor="end">90</text> <line x1="36" y1="108" x2="336" y2="108" class="gr"/><text x="28" y="112" text-anchor="end">120</text> <line x1="36" y1="20" x2="336" y2="20" class="gr"/><text x="28" y="24" text-anchor="end">150</text> <text x="36" y="216" text-anchor="middle">1주</text><text x="78.9" y="216" text-anchor="middle">2주</text><text x="121.7" y="216" text-anchor="middle">3주</text><text x="164.6" y="216" text-anchor="middle">4주</text><text x="207.4" y="216" text-anchor="middle">5주</text><text x="250.3" y="216" text-anchor="middle">6주</text><text x="293.1" y="216" text-anchor="middle">7주</text><text x="336" y="216" text-anchor="middle">8주</text> <polyline points="36,166.7 78.9,163.7 121.7,157.9 164.6,154.9 207.4,152 250.3,149.1 293.1,146.1 336,143.2" class="ln sub"/> <polyline points="36,166.7 78.9,154.9 121.7,140.3 164.6,128.5 207.4,105.1 250.3,84.5 293.1,61.1 336,43.5" class="ln hot"/> <circle cx="336" cy="143.2" r="4.5" class="dot s"/><circle cx="336" cy="43.5" r="6" class="dot"/><text x="348" y="45.5" class="va big">142</text><text x="348" y="62.5" class="v">우리 계정</text><text x="348" y="145.2" class="v big">108</text><text x="348" y="162.2">업종 평균</text> </svg></div> <p class="nt">예시 값 · 실제 집계 값과 기간으로 교체</p></div></div>
스타일
.dkh-g-line2 .dk-card{display:flex;flex-direction:column;padding:20px 26px 18px}
.dkh-g-line2 .dk-lb{flex:none;margin:0 0 10px}
.dkh-g-line2 .nt{flex:none;font-size:var(--f-cap);color:var(--mu);margin:8px 0 0}
.dkh-g-line2 .cv{flex:1;min-height:0;position:relative}
.dkh-g-line2 .cv svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.dkh-g-line2 svg text{font-family:inherit;font-size:13px;fill:var(--mu);font-variant-numeric:tabular-nums}
.dkh-g-line2 svg .k{fill:var(--ink2)}
.dkh-g-line2 svg .v{fill:var(--ink);font-weight:600}
.dkh-g-line2 svg .va{fill:var(--ac);font-weight:700}
.dkh-g-line2 svg .on{fill:var(--card);font-weight:600}
.dkh-g-line2 svg .t14{font-size:14px}
.dkh-g-line2 svg .f-a{fill:var(--ac)}
.dkh-g-line2 svg .f-w{fill:var(--acw)}
.dkh-g-line2 svg .f-s{fill:var(--soft)}
.dkh-g-line2 svg .f-c{fill:var(--card)}
.dkh-g-line2 svg .f-g1{fill:var(--g1)}
.dkh-g-line2 svg .f-g2{fill:var(--g2)}
.dkh-g-line2 svg .f-g3{fill:var(--g3)}
.dkh-g-line2 svg .f-g4{fill:var(--g4)}
.dkh-g-line2 svg .ax{stroke:var(--line2);stroke-width:1;fill:none}
.dkh-g-line2 svg .gr{stroke:var(--line);stroke-width:1;fill:none}
.dkh-g-line2 svg .ln{fill:none;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.dkh-g-line2 svg .ln.hot{stroke:var(--ac)}
.dkh-g-line2 svg .ln.sub{stroke:var(--g2);stroke-width:2}
.dkh-g-line2 svg .dot{fill:var(--ac);stroke:var(--card);stroke-width:2}
.dkh-g-line2 svg .dot.s{fill:var(--g3)}
.dkh-g-line2 svg .big{font-size:20px}