Skip to content

Types of Charts: A Complete Guide to Choosing the Right One

Bar, line, area, pie, donut, funnel, sankey, treemap, radar and more: what each chart type is best for, when to avoid it, and a live example of every one.

By , MiniDev11 min read

Every chart answers one question. Pick the chart by the question, not by how it looks: the same twelve numbers read as a story in a line chart and as noise in a pie chart. This guide covers the chart types you will meet in dashboards, reports and SaaS products, grouped by the question each one answers. Every section says what the chart is best for, when to avoid it, and shows a live example you can click, built with MiniDev UI, a free React and Tailwind kit.

Chart picker: what are you trying to show?

You want to showUseAvoid
Which item is biggerBar chart, horizontal bar chartPie chart with many slices
How a number changed over timeLine chart, area chartBar chart with 30+ bars
A trend in a small spaceSparklineA full chart with axes in a table cell
How a total splits into partsDonut, pie, stacked barPie chart with more than 5 slices
Many parts and their sizes at onceTreemapPie chart
Progress toward a goalRadial chart, progress barGauge with no target
Where people drop out of a processFunnel chartLine chart
Where things flow from and toSankey diagramSeveral pie charts
Several qualities of a few optionsRadar chartRadar chart with 10 options
Tasks on a scheduleGantt chartA table of dates
Who reports to whomOrg chartIndented list

Charts that compare amounts

People judge length along a common baseline more accurately than angle, area or colour. That single fact is why bar charts are the default for comparison, and why most chart advice comes back to them.

Bar chart

A bar chart shows one bar per category, with the length proportional to the value. Vertical bars (columns) read well for a handful of categories or for periods such as weeks and months.

Best for: revenue by month, signups by plan, tickets by team. Avoid when: you have more than about 12 categories, or the labels are long, because they will collide under the bars. Tip: always start the value axis at zero. A bar that starts at 80 makes a 5% difference look like a 50% one.

Loading the live Bar Chart…
Bar ChartWeekly values with a hover readout.Docs

Horizontal bar chart

The same chart turned on its side. Labels sit on the left at full length, so the chart stays readable with product names, countries or page URLs, and it scales to 20 or more rows by growing taller.

Best for: rankings (top pages, top customers, top errors) and any category list with long names. Avoid when: the categories are time periods; time reads left to right, so use columns or a line. Tip: sort the bars by value, largest first, unless the categories have a natural order.

Loading the live Horizontal Bar Chart…
Horizontal Bar ChartDocs

Radar chart

A radar (spider) chart plots several measures on axes that radiate from a centre, then joins the points into a shape. Two or three overlapping shapes make differences in profile visible at a glance.

Best for: comparing two or three options across 5 to 8 qualities, such as plans, candidates or product scores. Avoid when: you need exact values, or you are comparing more than three shapes; the overlap turns into a knot. Tip: keep every axis on the same scale, or the shape lies.

Loading the live Radar Chart…
Radar ChartTwo options compared across the same axes.Docs

Charts that show change over time

Line chart

A line chart joins values in time order, so the eye follows the trend rather than individual points. It is the clearest way to show direction, seasonality and sudden changes, and it handles hundreds of points without clutter.

Best for: traffic, revenue, latency, any metric over days, weeks or months; two or three series compared on the same axis. Avoid when: the x-axis is categories with no order, such as countries; a line between them implies a trend that does not exist. Tip: more than four lines on one chart becomes spaghetti. Split them into small multiples instead.

Loading the live Line Chart…
Line ChartTwo series with a legend.Docs

Area chart

An area chart is a line chart with the space under the line filled. The fill gives weight to volume, so it suits metrics where the total amount matters as much as the direction.

Best for: cumulative values, volumes such as storage used or requests served, and hero metrics on a dashboard card. Avoid when: you overlay several series; the fills hide each other. Use a line chart or a stacked area instead. Tip: a soft gradient fill reads as lighter than a solid one, which keeps a dashboard calm.

Loading the live Area Chart…
Area ChartAn area chart inside a stat card.Docs

Sparkline

A sparkline is a tiny line chart with no axes, sized to sit next to a number or inside a table cell. It answers one question, which way is this going, and leaves exact values to the number beside it.

Best for: KPI cards, table rows, and any summary where you want the trend without spending space on a chart. Avoid when: readers need to compare exact values or read dates. Tip: pair every sparkline with the current value and the change, such as $12,400 and +8%, so it never has to stand alone.

Loading the live Sparkline Set…
Sparkline SetDocs

Gantt chart

A Gantt chart lays tasks out as bars on a timeline, one row per task, with the bar's start and length showing when it happens and how long it takes. Dependencies, milestones and a today line make it a planning tool rather than just a picture.

Best for: project plans, release schedules, rollouts and anything with start and end dates. Avoid when: dates are approximate and change weekly; a simple ordered list or kanban board will be kept more up to date. Tip: show progress inside each bar so the chart answers both what is planned and what is done.

Loading the live Gantt Chart…
Gantt ChartDocs

Charts that show parts of a whole

Pie chart

A pie chart splits a circle into slices that add up to 100%. It is the most recognised chart there is, and the most misused: people compare angles poorly, so a pie works only when the parts are few and clearly different.

Best for: 2 to 5 parts where one or two dominate, such as share of traffic by device. Avoid when: slices are close in size, there are more than 5, or you need to compare two pies. Tip: label slices directly with their percentages; a legend makes the reader match colours back and forth.

Loading the live Pie Chart…
Pie ChartDocs

Donut chart

A donut is a pie chart with the centre removed. The hole is useful space: put the total, or the one number that matters, in the middle. Because readers judge arc length rather than angle, a donut is slightly easier to read than a pie.

Best for: a single split with a headline number, such as storage used by file type with the total in the centre. Avoid when: the same limits as a pie apply: few parts, clearly different sizes. Tip: start the first slice at 12 o'clock and go clockwise, largest to smallest.

Loading the live Donut Chart…
Donut ChartA donut with its total in the centre.Docs

Stacked bar chart

A stacked bar chart splits each bar into segments, so one chart shows both the total per category and how it is made up. It is the right answer to a pie chart with too many slices, and to a set of pies you want to compare.

Best for: revenue by month split by plan, tickets by week split by priority. Avoid when: readers need to compare the middle segments precisely, because they do not share a baseline. Only the bottom segment and the total are easy to compare. Tip: put the most important segment at the bottom.

Loading the live Stacked Bar Chart…
Stacked Bar ChartDocs

Treemap

A treemap fills a rectangle with smaller rectangles, each sized by value and optionally grouped. It shows dozens of parts at once, where a pie chart would turn into confetti.

Best for: budgets by department and line item, disk usage by folder, revenue by product and region. Avoid when: values are close together, or precise comparison matters; areas are hard to compare exactly. Tip: colour by group and label only the rectangles big enough to hold text.

Loading the live Treemap Chart…
Treemap ChartDocs

Radial chart

A radial chart draws one or more rings that fill toward a goal, like an activity ring. It is a compact way to show progress against a target rather than parts of a total.

Best for: quota used, goals reached, onboarding completion. Avoid when: there is no target; a ring that fills toward nothing means nothing. Tip: put the percentage in the centre and the absolute numbers underneath, such as 7.2 of 10 GB.

Loading the live Radial Chart…
Radial ChartDocs

Charts that show a process or a flow

Funnel chart

A funnel chart shows a sequence of steps with the number that reached each one, narrowing as people drop out. It makes the worst step obvious, which is the whole point of measuring a funnel.

Best for: signup and checkout flows, sales pipelines, onboarding. Avoid when: the steps are not sequential, or people can skip steps; then the narrowing shape is misleading. Tip: label each step with both the count and the conversion from the previous step, because the drop between steps is what you act on.

Loading the live Funnel Chart…
Funnel ChartDocs

Sankey diagram

A sankey diagram draws flows as ribbons whose width is proportional to quantity, from sources on the left to destinations on the right, through any number of middle stages. It shows where things come from and where they go in one picture.

Best for: traffic sources to signups to plans, budget from income to spending categories, energy or material flows. Avoid when: there are many small flows; they turn into hairlines that nobody can read. Group the small ones into Other. Tip: let readers hover a node to highlight only its flows.

Loading the live Sankey Chart…
Sankey ChartDocs

Charts that show structure

Org chart

An org chart is a tree: each box is a person or unit, and lines show who reports to whom. In a product it is often interactive, with collapsible teams and a selected person.

Best for: company structure, team directories, any hierarchy that is a few levels deep. Avoid when: the hierarchy is very wide or very deep; switch to a searchable list with breadcrumbs. Tip: collapse all but the first two levels by default.

Loading the live Org Chart…
Org ChartDocs

Five mistakes that make any chart worse

  1. Choosing the chart before the question. Write the question the chart answers as a sentence, such as Which plan grows fastest?, and pick the chart from the picker above.
  2. Truncating the axis of a bar chart. Bars encode value by length, so the axis must start at zero. Line charts can zoom in; bar charts cannot.
  3. Too many series. Past four lines or five slices, readers stop comparing and start decoding colours. Highlight one series and grey the rest, or split the chart.
  4. Relying on colour alone. About 1 in 12 men has some colour vision deficiency. Label series directly, and use position or pattern as well as colour.
  5. 3D effects and decoration. Perspective distorts size. Flat charts with light gridlines are read faster and more accurately.

Building these charts in React

For dashboards with a few thousand points or fewer, SVG charts are the simplest choice: they scale cleanly, take CSS colours and can be made accessible. Canvas libraries are worth it for tens of thousands of points or real-time streams. We compare the options in Best React chart libraries, and show a full dashboard in React charts with Tailwind.

Every chart on this page is a single React component with no charting dependency, so you can copy it into your project and edit it like your own code. Install any of them with the shadcn CLI, for example npx shadcn@latest add @minidev/bar-chart. Each one includes a hidden data table so screen readers get the numbers, not just a picture.

Not sure which one you need? Start with a bar chart for comparisons and a line chart for anything over time. Those two cover most of what a dashboard has to say.

Components used in this guide

Frequently asked questions

What are the main types of charts?

The main types are bar charts and horizontal bar charts for comparing amounts, line and area charts for change over time, pie, donut and stacked bar charts for parts of a whole, funnel and sankey charts for processes and flows, and structural charts such as org charts and Gantt charts.

Which chart is best for comparing data?

A bar chart. People compare lengths on a shared baseline more accurately than angles or areas, so bars beat pies for comparison. Use horizontal bars when the category names are long or there are many of them.

When should I use a line chart instead of a bar chart?

Use a line chart when the x-axis is time and you care about the trend: direction, seasonality or a sudden change. Use a bar chart when you compare separate categories, or a few periods where each total matters on its own.

Is a pie chart or a donut chart better?

A donut is usually slightly better. Readers judge arc length about as well as angle, and the empty centre can hold the total or the key number. Both work only for 2 to 5 parts of clearly different sizes.

What chart shows a process with drop-offs?

A funnel chart. Each step shows how many people reached it, and the narrowing makes the weakest step obvious. Label each step with its conversion from the previous one.

What is the difference between a funnel chart and a sankey diagram?

A funnel shows one path with people dropping out at each step. A sankey shows many paths at once, with ribbons that split and merge, so it answers where things went, not just how many were left.

How do I make charts accessible?

Give every chart a text title, label series directly instead of relying on colour alone, keep enough contrast, and provide the underlying numbers as a table for screen readers. The MiniDev UI charts include a visually hidden table for this.

More guides