Variance Chart: What It Is, When to Use It and How to Build One in React
A variance chart shows the difference between an actual value and a reference, usually budget, plan, forecast or last year, for each line item. Each row shows the variance as a bar from zero, positive to one side and negative to the other, often with the percentage variance printed next to it and the levels shown alongside. It's the core chart of a monthly business review.
Finance teams also call it a budget variance chart, a plan vs actual chart or a variance analysis chart. Whatever the name, the question is the same: where are we over or under, and by how much?
What a variance chart is
A typical variance chart has these parts:
- Line items. One row per category: cost centers, P&L lines, products or regions.
- Levels (optional but recommended). A bar for the actual with a tick or outline for the plan, so readers see how big each line is.
- The variance bar. A bar from a zero line to the difference, actual minus plan. Bars to the right are above plan, bars to the left below.
- Percentage variance. The difference as a percentage of plan, printed at the end of the bar.
- Favorable coloring. Color that shows whether the variance is good or bad for the business, not whether it's positive or negative.
The last point is what separates a good variance chart from a diverging bar chart with red and green. Revenue above plan is good. Cost above budget is bad. Both are positive numbers.
When to use a variance chart
- Monthly or quarterly business reviews. Which cost centers are over budget, which revenue lines are behind plan.
- Budget vs actual by department. A department head scanning where spending stands.
- Forecast accuracy. Actual vs last forecast by product, to see where the forecast missed.
- Year-over-year by line. This year minus last year per region.
- Operational targets. Units produced vs plan by plant.
When not to use a variance chart
- The question is what drove one total. "Why is operating income $400K below plan?" is a bridge question. Use a waterfall chart that walks from plan to actual by driver.
- You need the trend of a variance over time. One chart per month gets repetitive. A variance trend chart shows variance by period, split into drivers.
- There's only one number. For a single KPI against target, a bullet chart or a KPI tile is enough.
- The audience needs the exact numbers. For a board pack, a table with variance columns may be the primary view and the chart a summary.
- The reference isn't comparable. If the plan was set on a different basis (different scope, currency or accounting treatment), the variance misleads. Fix the data first.
How to read a variance chart
- Find the zero line. Bars to one side are above the reference, bars to the other side below.
- Read the color for meaning. Favorable variances in one color, unfavorable in another. Check the legend: favorable usually means income above plan or costs below budget.
- Compare bar lengths for size. The longest bars are the biggest absolute variances.
- Read the percentage for scale. A $50K variance on a $5M line (1%) is noise; on a $100K line (50%) it's a problem.
- Look at the levels. If levels are shown, check whether the big variances are on big lines.
Design rules for honest variance charts
Start bars at zero. Variance bars grow from a zero line, and level bars from zero too. Never cut the axis to make small variances look big.
Color by business direction, not by sign. Each row needs to know whether higher is good. When a chart mixes income and cost lines, set the direction per row. A blanket "positive is green" rule colors a cost overrun as good news.
Show absolute and percentage variance. The absolute bar shows what matters to the total; the percentage shows what matters to the line.
Keep a meaningful order. Finance readers expect P&L order: revenue lines first, then cost of sales, then operating expenses. Sort by variance only when the biggest misses are the story, and say so.
Label directly. Print "+$12.4K (+8%)" at the end of each bar. Use one magnitude per chart: don't mix "$1.2M" and "$45,000" in the same set of labels.
No dual axes. Show levels and variances as two aligned panels sharing the row labels, not as two scales on one plot.
State the reference and period. "Actual vs budget, year to date through September". Variance against what, and when, is half the meaning.
Handle missing plans honestly. If a line has no budget, show it as "no plan", not as a 100% variance.
Worked example: operating expenses vs budget
The numbers below are invented for illustration. A company reviews Q3 operating expenses by category against budget:
| Category | Actual | Budget | Variance | % variance |
|---|---|---|---|---|
| Salaries | $1,840K | $1,800K | +$40K | +2.2% |
| Cloud hosting | $412K | $360K | +$52K | +14.4% |
| Contractors | $198K | $160K | +$38K | +23.8% |
| Marketing | $305K | $340K | −$35K | −10.3% |
| Travel | $22K | $30K | −$8K | −26.7% |
| Software | $96K | $95K | +$1K | +1.1% |
Because these are all costs, over budget is unfavorable. In the chart, cloud hosting, contractors and salaries show bars to the right in the unfavorable color; marketing and travel show bars to the left in the favorable color; software is close to zero.
Reading the two measures together tells the real story. Travel has the largest percentage variance (−26.7%) but is only $8K. Cloud hosting and contractors are both large in dollars and in percent, so they're where the review should start.
A good title: "Cloud and contractors are $90K over budget; marketing is under". The subtitle: "Q3 operating expenses, actual vs budget".
How to build one in React
ChartslibraryUI includes a <VarianceChart /> component. It's part of Pro, a one-time purchase, so it isn't in the public shadcn registry. Install it from your local Pro download:
npx chartslibraryui add variance-chart --from ./chartslibraryui-proThe chart and the shared core/ folder are copied into components/charts/ as TypeScript source you own. The data is one row per line item with an actual and a plan, plus an optional per-row direction:
[
{ category: "Cloud hosting", amount: 412000, budget: 360000 },
{ category: "Travel", amount: 22100, budget: 30000 },
];What the component handles:
- Each row shows a level bar with a plan tick next to a variance bar with the percentage.
- Variance color follows business direction; for tables that mix income and cost lines, the direction can be read per row from your data.
- Rows keep your order by default, so P&L order is preserved.
- Bars start at zero, and tooltips, keyboard navigation, a table view and CSV export come from the shared core.
See the variance chart component page for a live demo and props. For a free starting point, the diverging bar chart draws signed values from zero.
FAQ
What is a variance chart? A chart that shows the difference between actual values and a reference such as budget, plan or last year, one bar per line item, drawn from a zero line.
How do you calculate variance for a variance chart? Absolute variance is actual minus plan. Percentage variance is that difference divided by plan. For costs, a positive variance (actual above budget) is unfavorable.
What colors should a variance chart use? One color for favorable and one for unfavorable, decided by business direction for each line, not by sign. Avoid relying on red and green alone; print the values too, so color-blind readers can follow.
What is the difference between a variance chart and a waterfall chart? A variance chart compares many line items with their own plans side by side. A waterfall chart explains how one total moved from plan to actual through a sequence of drivers.
Should a variance chart be sorted by size? Not by default. Finance readers expect P&L or category order. Sort by variance when the biggest misses are the point of the chart, and say so in the subtitle.
Can a variance chart show both revenue and cost lines? Yes, as long as each row knows its own favorable direction. Otherwise a cost overrun and a revenue beat get the same color.