Bar Chart

NEW

A hand-written, dependency-free SVG bar chart with grouped and stacked layouts, morphing bar transitions, interactive legend toggles, and accessible hover and keyboard tooltips.

Requests by platform

Monthly volume, last 12 months

02K4K6K8KJanFebMarAprMayJunJulAugSepOctNovDec
Chart data
CategoryWebMobileAPI
Jan2,400 req2,080 req900 req
Feb3,041 req2,126 req1,244 req
Mar2,948 req1,994 req913 req
Apr2,462 req1,926 req1,264 req
May2,501 req2,119 req1,602 req
Jun3,212 req2,570 req1,271 req
Jul3,759 req3,081 req1,629 req
Aug3,546 req3,410 req1,960 req
Sep3,090 req3,451 req1,629 req
Oct3,264 req3,317 req1,993 req
Nov4,018 req3,254 req2,318 req
Dec4,453 req3,452 req1,987 req

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/bar-chart

API Reference

PropTypeDefaultDescription
dataBarDatum[]—Categories to render; each row needs a label plus one numeric key per series
seriesBarSeries[]—Series definitions with a data key, display label, and optional color
variant"grouped" | "stacked""grouped"Places bars side by side or stacks them on top of each other
heightnumber260Height of the chart area in pixels
formatValue(n: number) => stringIntl.NumberFormatFormats values shown in tooltips and the accessible data table
formatTick(n: number) => stringcompact Intl.NumberFormatFormats the y-axis tick labels
showLegendbooleantrueShows the interactive series legend when more than one series exists
animatedbooleantrueEnables entrance and bar morph animations (disabled for reduced motion)
ariaLabelstringauto-generatedAccessible description for the chart image role
classNamestring""Additional CSS classes for the chart wrapper