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'] });import { StackedBar } from '@arshad-shah/swift-chart/react';
<StackedBar data={stacked} mapping={{ x: 'day', y: ['api', 'web', 'mobile'] }} theme="midnight" height={320}/>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
- Class:
StackedBarChart - React component:
StackedBar