---
code: "CMP-10"
id: "c-bump"
tab: "compare"
kind: "core"
title: "Bump · 순위 변동"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "comparison"
dataShape: "ranked categories or before-after pairs"
tasks: ["compare alternatives", "show delta", "benchmark groups", "compare categories"]
tags: ["comparison", "benchmark", "delta", "ranking", "bump", "순위", "변동"]
gallery: "https://graph.heal7.com/#CMP-10"
js: "/sku/CMP-10.js"
---

# [CMP-10] Bump · 순위 변동

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

## 언제 가져가나
시점별 순위가 위/아래로 교차하는 곡선 — slope의 다중 시점 버전.

**응용** 분기별 매출 순위, 키워드 트렌드 순위, 리그 순위 변동.

## 데이터 모양
- family: `comparison`
- dataShape: ranked categories or before-after pairs
- tasks: compare alternatives, show delta, benchmark groups, compare categories
- tags: comparison, benchmark, delta, ranking, bump, 순위, 변동


## 의존
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 items = ['A','B','C','D','E'];
  const ranks = [
    [1,2,3,4,5],
    [2,1,4,3,5],
    [2,3,1,5,4],
    [3,2,1,4,5],
    [1,3,2,4,5],
    [1,2,3,5,4]
  ];
  const xs = ['Q1','Q2','Q3','Q4','Q5','Q6'];
  const colors = [T.gold, T.royal, T.rose, T.teal, T.plum];
  const series = items.map((n,i)=>({
    type:'line', name:n, smooth:true, symbol:'circle', symbolSize:10,
    data: ranks.map(r => r[i]),
    lineStyle:{width:3, color:colors[i]},
    itemStyle:{color:colors[i], borderColor:'#fff', borderWidth:2},
    label:{show:true, color:T.fg, fontSize:10, formatter: p => p.value}
  }));
  reg('c-bump',{
    backgroundColor:T.bg,
    tooltip:{trigger:'axis'},
    legend:{data:items, top:0, textStyle:{color:T.sub}},
    grid:{top:30, right:24, bottom:24, left:32},
    xAxis:{type:'category', data:xs, axisLabel:{color:T.sub}, axisLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'value', inverse:true, min:1, max:items.length, interval:1, axisLabel:{color:T.sub, formatter: v => '#'+v}, splitLine:{lineStyle:{color:T.grid}}},
    series
  });
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 3135-3163
- gallery: https://graph.heal7.com/#CMP-10
- raw js: https://graph.heal7.com/sku/CMP-10.js

```js
function(){
  const items = ['A','B','C','D','E'];
  const ranks = [
    [1,2,3,4,5],
    [2,1,4,3,5],
    [2,3,1,5,4],
    [3,2,1,4,5],
    [1,3,2,4,5],
    [1,2,3,5,4]
  ];
  const xs = ['Q1','Q2','Q3','Q4','Q5','Q6'];
  const colors = [T.gold, T.royal, T.rose, T.teal, T.plum];
  const series = items.map((n,i)=>({
    type:'line', name:n, smooth:true, symbol:'circle', symbolSize:10,
    data: ranks.map(r => r[i]),
    lineStyle:{width:3, color:colors[i]},
    itemStyle:{color:colors[i], borderColor:'#fff', borderWidth:2},
    label:{show:true, color:T.fg, fontSize:10, formatter: p => p.value}
  }));
  reg('c-bump',{
    backgroundColor:T.bg,
    tooltip:{trigger:'axis'},
    legend:{data:items, top:0, textStyle:{color:T.sub}},
    grid:{top:30, right:24, bottom:24, left:32},
    xAxis:{type:'category', data:xs, axisLabel:{color:T.sub}, axisLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'value', inverse:true, min:1, max:items.length, interval:1, axisLabel:{color:T.sub, formatter: v => '#'+v}, splitLine:{lineStyle:{color:T.grid}}},
    series
  });
}
```

