Dashboards

Chart card with legend

CSS-only stacked bars and range picker

Live preview
Build an analytics chart card with Tailwind CSS using no charting library. The card header has a title, a subtitle with the total and a green delta, and a small segmented range picker (7d / 30d / 90d) where one option is active. The chart body is a flex row of column groups; each column is a rounded stacked bar built from two divs of different heights and shades, aligned to the bottom with items-end. Add x-axis labels beneath and a legend row with two colored dots naming the series. Then add JavaScript that renders the bars from a data array instead of fixed classes: hold one dataset per range, scale every bar as a percentage of the largest total so the chart always fills its height, redraw the bars, labels, total, and delta when the range changes, move the active pill, and give each column a title tooltip with its exact figures.