---
code: "TIM-08"
id: "c-gantt"
tab: "timeline"
kind: "core"
title: "Gantt · 간트 차트"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "schedule"
dataShape: "tasks with start and duration"
tasks: ["show trend", "show seasonality", "show sequence", "show trend over time", "show schedule"]
tags: ["time-series", "trend", "timeline", "gantt", "간트", "차트"]
gallery: "https://graph.heal7.com/#TIM-08"
js: "/sku/TIM-08.js"
---

# [TIM-08] Gantt · 간트 차트

> AI 붙여넣기 카드. 갤러리 런타임(`main.js`)이 아니라 이 파일을 가져와라.

## 언제 가져가나
작업별 시작–종료 막대 — 일정 의존성과 병렬성이 한눈에.

**응용** 프로젝트 일정, 채용 단계, 콘텐츠 발행 캘린더.

## 데이터 모양
- family: `schedule`
- dataShape: tasks with start and duration
- tasks: show trend, show seasonality, show sequence, show trend over time, show schedule
- tags: time-series, trend, timeline, gantt, 간트, 차트


## 의존
echarts@5 · load `low` · library `ECharts`

## 붙여넣는 법
1. echarts 5.x 로드 (GL이면 echarts-gl도)
2. 컨테이너 id를 원본 id와 맞추거나 `document.getElementById` 한 줄만 바꾼다
3. `T`, `reg`, `cssv` 가 필요하면 갤러리 테마 스텁을 함께 가져간다

```js
const T = {
  "bg": "transparent",
  "fg": "#ece8f5",
  "sub": "#a59bbd",
  "grid": "rgba(255,255,255,.08)",
  "gold": "#e8c069",
  "royal": "#6b8cff",
  "rose": "#e07a9f",
  "teal": "#6dd2c4",
  "plum": "#b487e8"
};
const cssv = (n, fb) => (getComputedStyle(document.documentElement).getPropertyValue(n).trim() || fb);
const isDark = () => document.documentElement.getAttribute('data-theme') !== 'light';
const charts = [];
const reg = (id, opt) => {
  const dom = document.getElementById(id); if (!dom) return;
  const c = echarts.init(dom, null, {renderer:'canvas'});
  c.setOption(opt);
  charts.push(c);
  return c;
};
const factory = function(){
  const tasks = [
    {n:'설계',   s:0,  d:8,  c:T.gold},
    {n:'구현',   s:6,  d:14, c:T.royal},
    {n:'QA',     s:18, d:6,  c:T.rose},
    {n:'배포',   s:22, d:4,  c:T.teal},
    {n:'모니터', s:24, d:6,  c:T.plum}
  ];
  reg('c-gantt', {
    backgroundColor:T.bg,
    tooltip:{formatter:p=>p.seriesIndex===0?'':p.data.n+': D'+p.data.s+'~D'+(p.data.s+p.data.d)},
    grid:{top:14,right:24,bottom:30,left:64},
    xAxis:{type:'value', max:30, axisLabel:{color:T.sub,fontSize:10, formatter:'D{value}'}, splitLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'category', data:tasks.map(t=>t.n), axisLabel:{color:T.fg,fontSize:11,fontWeight:600}, axisLine:{show:false}, axisTick:{show:false}, inverse:true},
    series:[
      {name:'_pre', type:'bar', stack:'g', data:tasks.map(t=>t.s), itemStyle:{color:'transparent'}, silent:true, animation:false},
      {name:'기간', type:'bar', stack:'g', data:tasks.map(t=>({value:t.d, n:t.n, s:t.s, itemStyle:{color:t.c, borderRadius:6}})),
        label:{show:true, color:'#fff', fontSize:11, fontWeight:700, formatter:p=>p.data.n+' ('+p.data.d+'d)'}}
    ]
  });
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 1831-1851
- gallery: https://graph.heal7.com/#TIM-08
- raw js: https://graph.heal7.com/sku/TIM-08.js

```js
function(){
  const tasks = [
    {n:'설계',   s:0,  d:8,  c:T.gold},
    {n:'구현',   s:6,  d:14, c:T.royal},
    {n:'QA',     s:18, d:6,  c:T.rose},
    {n:'배포',   s:22, d:4,  c:T.teal},
    {n:'모니터', s:24, d:6,  c:T.plum}
  ];
  reg('c-gantt', {
    backgroundColor:T.bg,
    tooltip:{formatter:p=>p.seriesIndex===0?'':p.data.n+': D'+p.data.s+'~D'+(p.data.s+p.data.d)},
    grid:{top:14,right:24,bottom:30,left:64},
    xAxis:{type:'value', max:30, axisLabel:{color:T.sub,fontSize:10, formatter:'D{value}'}, splitLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'category', data:tasks.map(t=>t.n), axisLabel:{color:T.fg,fontSize:11,fontWeight:600}, axisLine:{show:false}, axisTick:{show:false}, inverse:true},
    series:[
      {name:'_pre', type:'bar', stack:'g', data:tasks.map(t=>t.s), itemStyle:{color:'transparent'}, silent:true, animation:false},
      {name:'기간', type:'bar', stack:'g', data:tasks.map(t=>({value:t.d, n:t.n, s:t.s, itemStyle:{color:t.c, borderRadius:6}})),
        label:{show:true, color:'#fff', fontSize:11, fontWeight:700, formatter:p=>p.data.n+' ('+p.data.d+'d)'}}
    ]
  });
}
```

