Skip to content

Guides

How to make a chart from CSV data (and pick the right chart)

Turn a CSV or Excel export into a clear chart in Excel, Google Sheets, Python or a free online tool, and choose between column, bar, line, donut and scatter.

By Ketan ·

Most charts start life as a raw export: one row per order, per ticket or per visit. Before that can become a chart, two things have to happen. The rows need summarising, for example total revenue per region. Then you need a chart that shows that summary clearly.

I make charts from exports like this all the time, and almost every “this chart is confusing” moment comes from one of the two going wrong: the data wasn’t summarised the way the reader expected, or the chart type fought the data. This guide covers both.

The quick way: in your browser

The Chart maker does the summarising and the drawing in one step. Drop in a CSV or Excel file, or paste cells from a spreadsheet. Pick the column to group by and the number to total, choose a chart type, and download the result as PNG or SVG. The file is processed in your browser and never uploaded, and large files work too.

Step 1: summarise before you chart

A chart of raw rows is rarely what you want. With 5,000 orders, a column chart “by region” first has to combine the rows in each region. You have to decide how:

Combine with Answers Example
Sum How much in total? Revenue per region
Count How many rows? Orders per region
Average What’s typical? Average order value per region
Min / Max What are the extremes? Largest order per region

Getting this wrong is the most common charting mistake I see. An average of revenue per region looks completely different from the total, and both are correct answers to different questions. Put the choice in the title, for example “Total revenue by region”, so nobody has to guess.

From experience: when a stakeholder says a chart “looks wrong”, I check the aggregation before anything else. Nine times out of ten they expected a total and got an average, or a count of rows when they wanted a count of customers.

Step 2: pick the chart for the job

You want to show Use Why
Amounts per category Column Lengths from a shared baseline are the easiest thing for the eye to compare
Many categories, or long names Bar (horizontal) Labels read left to right instead of being squeezed or rotated
Change over time Line The slope shows the trend; points are joined because time is continuous
Parts of a whole (up to ~6) Donut Shows shares of a total, but only when the slices are clearly different
How two numbers relate Scatter Each dot is one row; patterns and outliers stand out

A few rules that save most charts:

  • Sort bars by value, largest first, unless the categories have a natural order like months or sizes.
  • Start bar and column axes at zero. A bar that starts at 900 makes a 5% difference look like 50%.
  • Keep it to about 8 colours. Beyond that, group the smallest into “Other” or split the chart in two.
  • Avoid donuts for close values. Angles are hard to compare: 23% and 25% look identical as slices, but obvious as bars.
  • Never use two y-axes. If two measures have different scales, make two charts.

In Excel

For a summary chart straight from raw rows, use a PivotChart:

  1. Click anywhere in your data.
  2. Go to Insert → PivotChart, and click OK.
  3. Drag the category (for example Region) into Axis and the number (for example Revenue) into Values. Excel sums it by default. Click the field under Values and choose Value Field Settings to switch to count or average.
  4. Change the chart type with Design → Change Chart Type.

If the data is already summarised, with one row per category, select it and use Insert → Recommended Charts.

In Google Sheets

Select the data and choose Insert → Chart. In the chart editor’s Setup tab, pick the chart type, then tick Aggregate next to the X-axis to combine repeated categories. The aggregate type (sum, average, count) is chosen from the dropdown next to each series.

In Python

pandas summarises and matplotlib draws:

import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv("sales.csv")
summary = df.groupby("region")["revenue"].sum().sort_values(ascending=False)

ax = summary.plot(kind="bar", color="#1f7a4d", rot=0)
ax.set_title("Total revenue by region")
ax.set_ylabel("")
plt.tight_layout()
plt.savefig("revenue-by-region.png", dpi=200)

For a line over time, group by the date column and use kind="line". Make sure the dates are real dates (pd.to_datetime) so they sort in calendar order rather than alphabetically.

Getting the chart into a report

  • Slides and documents: use a PNG at twice the size it will be shown. The Chart maker exports at double resolution, so it stays sharp on high-resolution screens.
  • Print or design tools: use SVG. It scales to any size without blurring and can be edited in Illustrator, Figma or PowerPoint.
  • Always include the numbers. A small table under the chart, or the data file, lets readers check a value without squinting at the axis.

If the export needs more reshaping first, such as filtering a date range, joining two files or calculating a new column, SQL on CSV can do that in the browser, and you can chart the result.