Skip to content

Stacked bar chart

import { StackedBarChart } from '@arshad-shah/swift-chart';
const chart = new StackedBarChart('#chart', { theme: 'midnight' });
chart.setData(stacked, { x: 'day', y: ['api', 'web', 'mobile'] });

Percent (100 %-stacked)

Pass percent: true to normalise every column to 100 % so each segment shows its share of the total instead of an absolute value.

Reference