Preview Updated 2026-05-10

SlopeChart

A → B parallel coordinates — directional changes pop instantly. A lightweight alternative for version comparisons, AB-tests, quarterly reviews.

Basic usage

Each { label, before, after } becomes a left-to-right line. Color is auto-set by direction: rising green / falling red / flat gray. Hover highlights the focused series and dims the rest.

背景 视口

API

PropTypeDefaultDescription
items{ label, before, after, color? }[]Data array
beforeLabelstring'之前'Left column header
afterLabelstring'之后'Right column header
heightnumber320Pixel height
colorByDirectionbooleantrueAuto-color by direction
format(v) => stringEndpoint value formatter
ariaLabelstringSR label
size'sm' | 'md' | 'lg''md'Font size scale

Events:

  • Vue: @hover / @select
  • React: onHover / onSelect

Payload: { index, item, delta } where delta = after - before.

反馈与讨论

SlopeChart · Discussion

0
0 / 600
正在加载评论...