Stacked Bar Chart
chartAlso known as: stacked column chart, stacked bar graph, segmented bar chart
설명 / Description
누적 막대 차트는 각 막대를 색상이 있는 구간으로 세분하여 표준 막대 차트를 확장하며, 각 구간은 하위 범주가 전체에 기여하는 몫을 나타냅니다. 막대의 전체 높이는 해당 범주의 총합을 보여주고, 개별 구간은 구성을 보여줍니다. 이러한 이중 인코딩 덕분에 누적 막대는 "각 범주는 얼마나 큰가?"와 "그것은 무엇으로 이루어져 있는가?"라는 두 질문에 동시에 답하는 데 효과적입니다.
A stacked bar chart extends the standard bar chart by subdividing each bar into colored segments, where each segment represents a sub-category's contribution to the total. The full bar height shows the overall total for that category, while the individual segments show the composition. This dual encoding makes stacked bars effective for answering two questions simultaneously: "how big is each category?" and "what is it made of?"
각 막대의 맨 아래 구간은 공통 기준선을 공유하여, 범주 간 비교가 가장 쉬운 구간이 됩니다. 위쪽 구간들은 서로 다른 수직 위치에 떠 있어 정밀한 비교가 더 어렵습니다. 이것이 근본적인 트레이드오프입니다: 누적 막대는 개별 구성 요소의 가독성을 희생하는 대신 총합과 부분-전체 관계를 하나의 뷰에서 보여줍니다.
The bottom segment of each bar shares a common baseline, making it the easiest segment to compare across categories. Upper segments float at different vertical positions, making their precise comparison more difficult. This is a fundamental tradeoff: stacked bars sacrifice the readability of individual components in exchange for showing the total and the part-to-whole relationship in a single view.
초점이 절대값이 아니라 순전히 비율에 있을 때, 100% 누적 막대 차트는 모든 막대를 동일한 높이로 정규화하여 범주 간 상대적 구성을 쉽게 비교할 수 있게 합니다. 이 변형은 여러 개의 파이 차트와 직접적으로 유사하지만, 정렬된 길이라는 지각적 이점을 가집니다.
When the focus is purely on proportions rather than absolute values, a 100% stacked bar chart normalizes all bars to the same height, making it easy to compare the relative composition across categories. This variant is directly analogous to multiple pie charts but with the perceptual advantage of aligned lengths.
언제 사용하나 / When to Use
- 각 범주의 총합과 세부 구성을 동시에 보여줄 때
- Showing both the total and the breakdown of each category simultaneously
- 적당한 수의 범주(5~15개)에 걸쳐 구성을 비교할 때
- Comparing composition across a moderate number of categories (5-15)
- 구간을 명확히 볼 수 있을 만큼 충분히 큰 2~5개의 하위 범주가 있을 때
- When there are 2-5 sub-categories whose segments are large enough to see clearly
- 그룹 전반에서 부분이 전체에 기여하는 방식을 보여줄 때(설문 응답, 제품 라인별 매출)
- Showing how parts contribute to a whole across groups (survey responses, revenue by product line)
이럴 땐 피하세요 / When NOT to Use
- 그룹 간 개별 하위 범주의 정밀한 비교가 필수적일 때 -- 대신 모든 하위 범주를 공통 기준선에 정렬하는 그룹 막대 차트를 사용하세요
- When precise comparison of individual sub-categories across groups is essential -- use a grouped bar chart instead, which aligns all sub-categories on a common baseline
- 하위 범주가 많을 때(6개 초과) -- 중간 구간이 가늘어져 읽기 어려운 조각이 됩니다
- When there are many sub-categories (>6) -- middle segments become thin slivers that are hard to read
- 총합이 의미가 없거나 비교 불가능할 때 -- 누적은 가산적 구성을 전제로 합니다
- When totals are not meaningful or comparable -- stacking implies additive composition
- 범주가 독립적이어서 하위 그룹으로 분해되지 않을 때 -- 단순한 막대 차트를 사용하세요
- When categories are independent and do not decompose into sub-groups -- use a plain bar chart
구조 / Anatomy
- 누적 구간: 각 막대 안의 색칠된 직사각형으로, 하위 범주별로 하나씩입니다. 높이가 하위 범주의 값을 인코딩합니다.
- Stacked segments: Colored rectangles within each bar, one per sub-category. Heights encode the sub-category's value.
- 막대 총합: 누적 막대의 전체 높이는 모든 하위 범주의 합을 나타냅니다.
- Bar total: The full height of the stacked bar represents the sum across all sub-categories.
- 범주 축: 주요 그룹화 변수를 나열합니다.
- Category axis: Lists the primary grouping variable.
- 값 축: 수량 스케일; 반드시 0에서 시작해야 합니다.
- Value axis: Quantitative scale; must start at zero.
- 색상 범례: 색상을 하위 범주에 매핑합니다. 축에 구간마다 개별 레이블이 붙지 않으므로 필수적입니다.
- Color legend: Maps colors to sub-categories. Essential since segments are not individually labeled on the axis.
- 구간 레이블: 각 구간 안이나 근처에 붙는 선택적 값 주석으로, 막대 수가 적을 때 유용합니다.
- Segment labels: Optional value annotations inside or near each segment, useful when there are few bars.
- 기준선: 모든 누적이 시작되는 차트 하단(y = 0).
- Baseline: The bottom of the chart (y = 0) from which all stacking begins.
변형 / Variations
- 100% 누적 막대 차트: 모든 막대가 동일한 높이(100%)로 정규화되어 상대적 비율만 보여줍니다. 절대값이 덜 중요할 때 구성을 비교하는 데 유용합니다.
- 100% stacked bar chart: All bars are normalized to the same height (100%), showing only relative proportions. Useful for comparing composition when absolute values are less important.
- 수평 누적 막대 차트: 막대가 수평으로 뻗어나가며, 긴 범주 레이블이나 리커트 척도 데이터에 유용합니다.
- Horizontal stacked bar chart: Bars extend horizontally, helpful for long category labels and for Likert-scale data.
- 발산형 누적 막대 차트: 막대가 중심점에서 양방향으로 뻗어나가며, 중립적인 중간값이 있는 설문 데이터(예: 매우 반대에서 매우 찬성까지)에 흔히 사용됩니다.
- Diverging stacked bar chart: Bars extend in both directions from a center point, commonly used for survey data with a neutral midpoint (e.g., Strongly Disagree to Strongly Agree).
- 그룹 + 누적: 막대가 한 변수로 그룹화되고 다른 변수로 누적되는 하이브리드 방식으로, 3단계 분해에 사용됩니다.
- Grouped + stacked: A hybrid where bars are grouped by one variable and stacked by another, for three-level breakdowns.
- 폭포 차트: 구간이 순차적인 증가와 감소를 보여주는 관련 형식으로, 초기값에서 시작해 최종 총합으로 끝납니다.
- Waterfall chart: A related form where segments show sequential additions and subtractions, starting from an initial value and ending at a final total.
코드 레퍼런스 / Code Reference
// Observable Plot - stacked bar chart
Plot.plot({
marks: [
Plot.barY(data, Plot.stackY({
x: "quarter",
y: "revenue",
fill: "product",
tip: true
})),
Plot.ruleY([0])
],
x: { label: "Quarter" },
y: { label: "Revenue ($M)" },
color: { legend: true }
})