Skip to content

ChartBarList

The ChartBarList component displays data as a horizontal bar list with customizable styling, tooltips, and legends. Built with ApexCharts.

import { ChartBarList } from '@fintech-sandpit/ui/react';
const data = [
{ name: 'Product A', value: 320 },
{ name: 'Product B', value: 280 },
{ name: 'Product C', value: 245 },
];
return (
<ChartBarList
data={data}
height="400px"
showTooltip={true}
showLegend={true}
/>
);
NameTypeDefaultDescription
dataChartBaseDataItem[]Array of data objects where each object represents a data point with name and value
widthCssUnit'100%'Width of the chart container (CSS unit string like ‘100%’, ‘400px’, ‘50rem’)
heightCssUnit'400px'Height of the chart container (CSS unit string like ‘400px’, ‘50vh’)
legendPositionLegendPosition'bottom'Position of the legend
orientationOrientation'horizontal'Orientation of the bars ('horizontal' or 'vertical')
showTooltipbooleantrueWhether to display tooltips on hover
showLegendbooleantrueWhether to display the legend
colorsstring[]Array of colors for the chart bars
type CssUnit = `${number}${'px' | 'em' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax' | '%'}`
type LegendPosition = 'top' | 'bottom' | 'left' | 'right'
type Orientation = 'horizontal' | 'vertical'
type ChartBaseDataItem = {
name: string;
value: number;
}