Preview Updated 2026-05-10

DualAxisChart

Bar + line dual-Y combo — show absolute values (bars) and relative rates (line) on one chart. The most common business dashboard staple.

Basic usage

bar drives the left Y axis, line drives the right Y axis. Both share the categories X axis. Typical pairings: revenue + growth %, page views + bounce rate, orders + average order value.

背景 视口

API

PropTypeDefaultDescription
categoriesstring[]Shared X-axis labels
bar{ label, data, color? }Bar series (left Y)
line{ label, data, color?, smooth? }Line series (right Y); smooth enables Bezier smoothing
heightnumber240Pixel height
formatBar(v) => stringBar value / left-axis formatter
formatLine(v) => stringLine value / right-axis formatter
ariaLabelstringSR label
size'sm' | 'md' | 'lg''md'Font size scale

Events:

  • Vue: @hover(payload \| null) / @select(payload)
  • React: onHover / onSelect

Payload: { index, category, barValue, lineValue }.

反馈与讨论

DualAxisChart · Discussion

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