Charts / React basic charts
React basic charts
The everyday charts done properly: line, area, bar, stacked and grouped bars, pie, scatter, bubble, funnel, waterfall, box plot, timeline and KPI cards, as React components in SVG.
npm i klar-charts
- Line chart: One or more series over time, with gaps where data is missing, labelled line ends and a crosshair that reads every series at once.
- Stacked area: How a total is made up over time, switchable between real amounts and each layer’s share of 100%.
- Step line: A value that holds and then jumps, such as a price or a limit, with each change marked and how long it lasted on hover.
- Combo chart: Bars on the left axis and a line on the right axis, for two measures in different units that should be read together.
- Grouped bar: Two to four series side by side in every category, as columns or rows, so both the categories and the series can be compared.
- Horizontal bar: A ranked list of categories with long names, each bar carrying its value and an optional tick for a target or the previous period.
- 100% stacked bar: Every category stretched to the same length so the mix can be compared, with shares inside the segments and totals at the end.
- Pie chart: A simple part-to-whole split with every slice labelled on a leader line, small items grouped into Other, and an optional donut total.
- Scatter plot: Two measures plotted against each other and coloured by group, with median lines, named quadrants and labelled outliers.
- Bubble chart: A scatter plot with a third measure as bubble area and a fourth as colour, with a size key and names that never overlap.
- KPI card: A big figure with a delta chip that knows whether a rise is good or bad, the comparison period, and a sparkline, mini bars or progress to…
- Lollipop chart: A stem and a dot per category, sorted, with value labels and one item highlighted; switch the baseline from zero to a target to see who is…
- Range bar: A min-to-max bar per row with a midpoint tick, a dot for the current value and a hatched benchmark range, flagging values that fall outside…
- Diverging bar: Answers stacked around a centre line, disagreement to the left and agreement to the right with neutral straddling the middle, or one signed…
- Data table with inline charts: Rows with a chart per column type: in-cell bars, deltas, sparklines, heat cells, badges and progress, with sortable sticky headers, a…
- Box plot: Median, quartiles and 1.5 × IQR whiskers per group, computed from the raw values, with outliers as dots, a mean marker and sample sizes.
- Funnel chart: Stages joined by tapered connectors, each with its value and share of the top, the step conversion on the connector and the number lost…
- Waterfall: A bridge from an opening total to a closing one: floating gains and losses, hatched subtotals, connectors and value pins, with the running…
- Linear meter: Progress to a goal on a scaled track with threshold zones, a target pin and last period’s ring, compact enough to stack a whole scorecard.
- Timeline: Events on a time axis with labels staggered above and below so none collide, periods as spans, categories by colour and icon, and a marker…