Preview Updated 2026-05-10

100% stacked bar

Horizontal 100% stacked bar — well suited to share-of-total breakdowns.

Basic usage

Data is passed via props and rendered as pure SVG, with no third-party charting dependency. Colors are drawn from the --viz-1..8 tokens and are colorblind-friendly.

Demo source
src/App.vue vue
<CfStackedBar100 ... />
src/App.tsx tsx
<CfStackedBar100 ... />

Trend comparison

Stacking bars from multiple years makes share migration easy to read.

2024 浏览器份额
2025 浏览器份额
Demo source
src/App.vue vue
<CfStackedBar100 :segments="seg2024" />
<CfStackedBar100 :segments="seg2025" />
src/App.tsx tsx
<CfStackedBar100 segments={seg2024} />
<CfStackedBar100 segments={seg2025} />

API

PropTypeDefaultDescription
segmentsStackedBar100Series[]{ name, value, colorIndex? }[]
heightnumber24
showLegendbooleantrue

反馈与讨论

100% stacked bar · Discussion

0
0 / 600
一键发送
正在加载评论...