SVG Chart Generator: Bars, Lines and Pies as Real SVG

Paste label,value rows, pick a chart type, and get markup you can edit — bars as paths, a grid as one path, labels as text. No chart library is loaded, no canvas is screenshotted, and nothing leaves the tab.

Bar / line / pie / donutEditable SVGSVG + PNGNo CDN

1. Data and shape

—
Chart type
Title
Labels

2. Preview

—

3. Generated markup

what ends up in the file

This page used to load a charting library from a CDN and hand you a PNG. Two problems followed from that: the file you downloaded could not be edited, and the page needed a network round trip before it could draw anything. Both are gone — the charts here are generated as SVG geometry, in the tab, with no third-party script.

Four shapes cover most business charts

Bars compare independent categories. Lines show a trend across an ordered axis. Pies and donuts show parts of a whole. Everything else — stacked bars, scatter plots, area charts — is a variation, and the choice between them is a question about your data, not about the tool:

Question the reader asksRight shapeWhy
Which category is biggest?BarLength is the easiest quantity to compare, and bars sit on a common baseline
Is it going up or down over time?LineThe connecting stroke encodes direction; bars hide it
What share of the total is each part?Pie or donutAngles sum to a whole, which is exactly the claim being made
How do two series compare over time?Line, two strokesOverlaid lines share one axis and one scale

The failure mode to avoid is the kitchen-sink chart: eight categories, two axes and a trend line. If the reader needs a legend longer than the chart, split it into two charts.

Why the output is genuinely vector

A canvas chart is a picture of a chart. It cannot be enlarged, it cannot be recoloured without redrawing, and its labels are unselectable pixels. Here every element is a node in the SVG tree:

Measured on the default six-row chart: 3,749 bytes as SVG against 66,745 bytes as a 2× PNG, and the six bars together occupy 161 bytes of path data versus 413 bytes when each bar is written as its own <rect>. The saving is small in absolute terms and large in structure — one element to restyle instead of six.

The same six data points drawn as a bar chart, a line chart and a pie chart, each exported as SVG paths
One data field, three shapes, one geometry pass · swipe to see it all

Data entry rules that avoid silent errors

The format is label,value, one point per line, and the parser splits on the last comma so that a label can contain one. Lines beginning with # are comments and blank lines are ignored. Anything that does not parse is reported with its line number rather than being dropped — a chart drawn from four of your eleven rows is worse than an error message, because it looks correct.

What to do with the file next

Paste the markup into the SVG editor to move a label or add an annotation, run it through the optimizer before shipping, or wrap it as a component with SVG to Code. For colour, pick a categorical ramp first with the palette generator; if your numbers live in a spreadsheet export, JSON to CSV gets them into rows. Pie-only work is also available on the dedicated pie chart maker page.

Frequently asked questions

Is this a real SVG or a screenshot?

Real geometry: bars as sub-paths, one path for the grid, labels as text nodes. No canvas bitmap is embedded.

Why no chart library?

The four shapes need a few hundred lines of geometry. A library costs hundreds of kilobytes and usually exports only a bitmap.

Can a label contain a comma?

Yes — the value is read after the last comma, so Q1, North, 12 works.

Do negative values work?

Bars and lines yes, the axis covers the minimum. Pies and donuts cannot represent a share below zero, and the tool says so.

Does it work offline?

Yes. No script, font or stylesheet is fetched from a third party.

Related tools