CSV to Chart
Operator: Abdulla Al Fahad. How tools are built and checked
CSV to Chart takes a table you already have, such as a sales export, a survey tally or a budget sheet, and draws a bar, line or pie chart from it. You choose a label column and up to three value columns for a bar or line chart, or one value column for a pie. The chart redraws as you change options, and you can download it as an SVG file or a PNG image.
A value written as "$1,020" or "1,240.50" is read as a number, but "12,5" is refused rather than guessed at, and a pie chart shows its seven largest values with everything else added into one "Other (grouped)" slice. The SVG you download contains your chart and nothing else.
Key features
- Four chart types: vertical bar, horizontal bar, line and pie.
- Up to three value columns on bar and line charts, drawn as separate series with a legend.
- Sort bars and pie slices by file order, largest first or smallest first.
- Show between 1 and 50 rows on bar and line charts (20 by default).
- Pie charts keep the seven largest values and add the rest together as one "Other (grouped)" slice.
- Negative values on bar and line charts are drawn below a visible zero line.
- SVG download with a title, a text description and role="img" for screen readers.
- PNG download rendered at twice the SVG size, on white or a transparent background.
- A list of every row that was skipped and why, plus a table of the exact values drawn.
What changes between CSV and SVG or PNG chart
The input is a comma-separated file with a header row. The header names become the column choices and the legend text, so a header like "Q1 sales" reads better in the finished chart than "col_b". Quoted fields are supported, which matters because many exports quote any value containing a comma, for example "$48,200".
Numbers are read with a dot as the decimal mark. Before parsing, the tool removes common currency symbols ($, €, £, ¥, ₹ and a few others), spaces, a trailing percent sign and commas that sit in thousands positions. A leading minus sign or a value wrapped in parentheses, the accounting style for losses, is read as negative, so "(1,200)" becomes -1200.
Comma-decimal numbers, written as 12,5 in much of Europe, are out of scope in this version. Rather than silently reading "12,5" as 125, the tool refuses any value whose commas are not in thousands positions and lists that row as skipped. If your file uses comma decimals, convert the column to dot decimals first.
The SVG output is 800 pixels wide, with a height that depends on the chart type and the number of rows. Text is at least 12 pixels at that size, and all labels are escaped for XML, so a category named R&D <2026> appears correctly instead of breaking the file. The PNG is the same drawing rasterised at 1600 pixels wide.
How it works
When you paste or upload a CSV, the page splits it into a header row and data rows, then guesses a starting setup: the first column that is mostly text becomes the label column and the first column that is mostly numbers becomes the value column. You can change both straight away.
For each data row, the tool reads the label and every selected value column. If any selected value is blank or cannot be read as a number, the whole row is skipped and recorded with its row number (the header counts as row 1, as in a spreadsheet) and the reason. A value with so many digits that it cannot be held as a finite number is skipped and listed in the same way, with the reason "too large to chart". Rows are never half-drawn with a missing series.
Sorting uses the first selected value column. The row limit is then applied, so "largest first" with a limit of 10 gives you the ten biggest values. Line charts ignore sorting because reordering points on a line would break the sequence the line is meant to show.
The chart itself is built as SVG markup. Bars grow from a single zero baseline with rounded outer ends, lines are two pixels wide with small markers when there are 30 points or fewer, and the axis scale is rounded to clean steps. Each bar, point and slice carries a tooltip with its exact value, which shows when you hover it in a browser.
For PNG, the page loads the SVG into an image, paints it onto a canvas at double size, fills the background with white unless you chose transparent, and saves the canvas as PNG. All of this happens locally.
Common use cases
- A regional manager turning a five-row quarterly sales export into a grouped bar chart for a monthly update.
- A teacher charting how many students chose each option in a class survey exported from a form tool.
- A small charity showing how its spending splits between programmes, fundraising and admin as a pie chart in an annual report.
- A blogger plotting monthly page views from an analytics CSV as a line chart, saved as SVG so it stays sharp on high-density screens.
- An analyst who needs a quick figure for a slide and does not want to open a spreadsheet app or sign up for a chart service.
How to use this tool
- Paste your CSV into the input box or click to upload a .csv file. The title is set from the file name; edit it if you want something different.
- Choose the chart type. Use horizontal bars when labels are long, a line when the rows are in time order, and a pie only when the values are parts of one total.
- Pick the label column, then tick one value column, or up to three for bar and line charts. The colour swatch next to each ticked column matches its series in the chart.
- Set the sort order and the number of rows to show. Check the summary under the chart for skipped rows or rows hidden by the limit.
- Download the SVG for documents and web pages, or the PNG for tools that only accept images. Choose a transparent background first if the chart will sit on a coloured slide.
Example
CSV input (Region as labels, Q1 sales as the value, pie chart, largest first)
Region,Q1 sales,Q2 sales
North,"$48,200","$52,900"
South,"$31,750","$29,400"
East,"$44,100","$47,350"
West,"$27,900","$33,600"
Central,"$19,450","$21,800"What the chart shows
Pie chart, 5 slices, total 171,400
North 48,200 28%
East 44,100 26%
South 31,750 19%
West 27,900 16%
Central 19,450 11%
SVG description: "Pie chart of Q1 sales by Region, 5 items.
Highest Q1 sales: North at 48,200. Lowest: Central at 19,450."Tips for best results
- Tick both Q1 and Q2 on a vertical bar chart to get grouped bars per region; that comparison is hard to read as two pies.
- Put the title you want in the box before downloading. It is also used for the download file name.
- If a pie has many small values, look at the "Other (grouped)" note in the summary to see how many rows were folded into it.
- Open the "Data shown in the chart" table to double-check the numbers that were actually drawn after parsing and sorting.
- Use SVG when the chart goes into a web page or a design tool, since it scales without blurring and the text stays selectable.
Edge cases to watch
A column that mixes numbers with notes such as "n/a" or "TBC" will lose those rows. They are listed in the skipped-row summary, but the chart will not warn you visually that a category is missing.
Pie charts refuse negative values and a zero total, because there is no meaningful slice for a negative share. Use a bar chart for data that can go below zero, such as profit and loss.
Duplicate labels are drawn as separate bars with the same name. The tool does not add up rows that share a label, so aggregate your data first if your export has one row per transaction.
Long labels on a vertical bar chart are tilted and shortened with an ellipsis. The full label is still in the hover tooltip and the data table, but a horizontal bar chart usually reads better.
Common errors and how to fix them
- "A pie chart cannot show negative values"
- One of the values in the chosen column is below zero. Switch to a vertical or horizontal bar chart, which draws negative values below the zero line, or choose a column that only holds positive amounts.
- "No rows had a number in every selected value column"
- Every row failed to parse. Check that you ticked a numeric column, and look at the skipped-row list for the reason. A common cause is comma decimals such as 4,5, which this version does not read.
- Rows are listed as skipped with "uses commas outside thousands positions"
- The value looks like a comma-decimal number or a list. Replace the decimal commas with dots in the source file, or export the spreadsheet with a dot decimal setting, then paste it again.
- The PNG download fails with a message to use the SVG instead
- Some locked-down browsers block drawing an SVG onto a canvas. The SVG download still works and can be converted to PNG in most image editors.
Best practices
- Choose bars for comparing categories, a line for values in time order and a pie only when the slices add up to a meaningful whole.
- Keep to one unit per chart. Plotting revenue and order count together gives one series that dwarfs the other; make two charts instead.
- Sort bars largest first when the order of categories has no meaning of its own, so readers see the ranking at a glance.
- Name columns in the CSV the way you want them to appear in the legend before you upload.
- Keep the exported data table or the CSV alongside the chart image, so readers who cannot see the colours can still check the numbers.
Colours, accessibility and what you cannot change
Series and slices use a fixed set of seven colours in a fixed order, and you cannot change them. Some of these colours, such as the yellow and the pink, have low contrast against a white background, so the chart does not rely on colour alone: pie slices are labelled by name, and a "Data shown in the chart" table under the preview lists every value drawn. The first value column is always blue, the second orange and the third green, and the order never shuffles when you add or remove a column. The "Other (grouped)" slice of a pie is grey.
Text is always dark ink rather than the series colour, and every chart with more than one series has a legend. Pie charts print the value and percentage for each slice beside its name, so the chart can be read without matching colours. The downloaded SVG has a title and a written description that screen readers announce.
- No custom colour themes beyond the built-in palette.
- No custom fonts; text uses the system sans-serif font of whatever opens the SVG.
- No stacked bars, area charts, scatter plots or dual axes in this version.
- No axis titles or annotations; put context in the chart title or the surrounding text.
Limits in this version
Bar and line charts show at most 50 rows, and pie charts show seven named slices plus "Other (grouped)". These caps keep labels readable at 800 pixels wide. If you need more categories, filter or group the CSV first so the chart has a clear point.
The tool reads the first selected value column for sorting and for the summary description, and up to three value columns overall. Values are plotted as given; nothing is averaged, totalled per label or converted between currencies.
Frequently asked questions
Is there a watermark on the SVG or PNG?
No. The download contains only your chart: the title, axes, legend and data marks. There is no logo, link or credit line added to the image.
Is my CSV uploaded to a server?
No. The page reads the file you pick with the browser's own file API, parses it and builds the SVG with JavaScript in the tab, and makes the PNG by painting that SVG onto a canvas.
Why does the pie chart only show seven slices?
The palette has seven colours. Beyond that, colours would have to repeat, so the smaller values are added together as one grey "Other (grouped)" slice and the summary tells you how many rows it contains.
Can I use numbers written like 1.234,56?
Not in this version. The parser expects a dot as the decimal mark and commas only as thousands separators. Values in the European format are listed as skipped rather than misread.
Can I edit the SVG afterwards?
Yes. It is plain SVG markup with text elements and paths, so it opens in Inkscape, Illustrator, Figma and most vector editors, where you can change colours or fonts yourself.
How large is the PNG?
The PNG is twice the size of the SVG, so 1600 pixels wide. Its height depends on the chart type and the number of rows.