---
code: "TIM-06"
id: "c-step"
tab: "timeline"
kind: "core"
title: "Step Line · 계단 라인"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "time-series"
dataShape: "time-indexed series, events or schedules"
tasks: ["show trend", "show seasonality", "show sequence"]
tags: ["time-series", "trend", "timeline", "step", "line", "계단", "라인"]
gallery: "https://graph.heal7.com/#TIM-06"
js: "/sku/TIM-06.js"
---

# [TIM-06] Step Line · 계단 라인

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

## 언제 가져가나
변동 시점에만 값이 점프 — 상태 전이를 정확히 표현.

**응용** 가격 변경 이력, 버전 출시, 정책 시행.

## 데이터 모양
- family: `time-series`
- dataShape: time-indexed series, events or schedules
- tasks: show trend, show seasonality, show sequence
- tags: time-series, trend, timeline, step, line, 계단, 라인


## 의존
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 data = [10,10,15,15,15,22,22,22,22,30,30,28,28,28,35];
  reg('c-step', {
    backgroundColor:T.bg, grid:{top:14,right:14,bottom:24,left:32}, tooltip:{trigger:'axis'},
    xAxis:{type:'category', data:Array.from({length:15},(_,i)=>'D'+(i+1)), axisLabel:{color:T.sub,fontSize:9}, axisLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'value', axisLabel:{color:T.sub,fontSize:10}, splitLine:{lineStyle:{color:T.grid}}},
    series:[{type:'line', data, step:'middle', symbol:'circle', symbolSize:6,
      lineStyle:{color:T.gold, width:2.5}, itemStyle:{color:T.gold},
      areaStyle:{color:'rgba(232,192,105,.18)'}
    }]
  });
};
factory();
```

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

```js
function(){
  const data = [10,10,15,15,15,22,22,22,22,30,30,28,28,28,35];
  reg('c-step', {
    backgroundColor:T.bg, grid:{top:14,right:14,bottom:24,left:32}, tooltip:{trigger:'axis'},
    xAxis:{type:'category', data:Array.from({length:15},(_,i)=>'D'+(i+1)), axisLabel:{color:T.sub,fontSize:9}, axisLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'value', axisLabel:{color:T.sub,fontSize:10}, splitLine:{lineStyle:{color:T.grid}}},
    series:[{type:'line', data, step:'middle', symbol:'circle', symbolSize:6,
      lineStyle:{color:T.gold, width:2.5}, itemStyle:{color:T.gold},
      areaStyle:{color:'rgba(232,192,105,.18)'}
    }]
  });
}
```

