Skip to content
UniKit

Chart maker

Render a data table into pure SVG across eight chart types: line, bar, stacked bar, pie, donut, area, scatter and radar. The first row is the header, and the delimiter and canvas size are configurable.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Data table (header row first, categories in column 1)

SVG result

Statistics first, then the SVG source you can copy

Enter a table with at least two columns (header row first) to draw an SVG

What this tool does

  • Turn a table (header row first, category names in the first column) into one of eight charts — line, bar, stacked bar, pie, donut, area, scatter or radar — with a live preview on the page plus the raw SVG source you can paste into Markdown, email or anywhere SVG renders.
  • Export straight from the preview: “Export SVG” downloads the source file and “Export PNG” rasterises the same SVG in your browser at exactly the canvas size you configured — everything local, nothing uploaded.
  • Paste straight out of Excel or a database: the delimiter is detected from the first line (tab, comma or semicolon) and quoted fields follow CSV rules (a doubled "" is one quote character).
  • Nothing about the options requires editing the data: chart type, palette (6 sets), canvas size (240–2400) and the legend / grid / value labels all switch on the page and recompute immediately.
  • Everything is drawn in the browser with no network requests and no font-measurement API — text width is estimated as 1 unit for CJK and 0.55 for Latin, so Node and the browser produce byte-identical SVG.

Example

Input

品类,销量
苹果,3
梨,5

Output

Chart type: line · canvas 720 × 420 · palette default
Data: 2 rows × 1 series (2 data points)
Legend: 销量

SVG source:
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="420" viewBox="0 0 720 420" font-family="system-ui, -apple-system, sans-serif">
  <line x1="56" y1="366" x2="692" y2="366" stroke="#9ca3af" stroke-width="0.5" />
  <text x="48" y="370" font-size="11" fill="#6b7280" text-anchor="end">0</text>
  <line x1="56" y1="280.5" x2="692" y2="280.5" stroke="#9ca3af" stroke-width="0.5" />
  <text x="48" y="284.5" font-size="11" fill="#6b7280" text-anchor="end">1.25</text>
  <line x1="56" y1="195" x2="692" y2="195" stroke="#9ca3af" stroke-width="0.5" />
  <text x="48" y="199" font-size="11" fill="#6b7280" text-anchor="end">2.5</text>
  <line x1="56" y1="109.5" x2="692" y2="109.5" stroke="#9ca3af" stroke-width="0.5" />
  <text x="48" y="113.5" font-size="11" fill="#6b7280" text-anchor="end">3.75</text>
  <line x1="56" y1="24" x2="692" y2="24" stroke="#9ca3af" stroke-width="0.5" />
  <text x="48" y="28" font-size="11" fill="#6b7280" text-anchor="end">5</text>
  <polyline points="56,160.8 692,24" fill="none" stroke="#4d6bfe" stroke-width="2" stroke-linejoin="round" />
  <circle cx="56" cy="160.8" r="3" fill="#ffffff" stroke="#4d6bfe" stroke-width="2" />
  <circle cx="692" cy="24" r="3" fill="#ffffff" stroke="#4d6bfe" stroke-width="2" />
  <text x="56" y="384" font-size="11" fill="#6b7280" text-anchor="middle">苹果</text>
  <text x="692" y="384" font-size="11" fill="#6b7280" text-anchor="middle">梨</text>
  <line x1="56" y1="366" x2="692" y2="366" stroke="#374151" stroke-width="1" />
</svg>

Real output for that table with the page defaults (line chart, 720 × 420, default palette), copied straight from the result box. The data has a single series, so by design no legend is drawn.

Frequently asked questions

What input format is expected?

The first line is the header: the first column holds category names (x axis / slice labels) and every other column is a data series, so at least two columns are required. At least one data row, at most 500. The delimiter is whichever of tab, comma or semicolon appears most often in the first line, so a straight copy-paste from Excel works. Numeric cells may contain thousands separators, percent signs and spaces (stripped); anything else fails with the row number in the message.

Why do pie and donut charts accept only one series?

A pie or donut slices the quantity of a single series into angles, so extra series are meaningless: passing more than one column is an explicit error (too-many-series) instead of silently drawing only the first. Slice percentages are computed from the total, and a total of zero or less is rejected.

What about the canvas size?

720 × 420 by default, adjustable from 240 to 2400; out-of-range numbers are clamped rather than rejected, and only a plotting area smaller than 20px is an error. The axis maximum is rounded up to a “nice” number (1/1.25/1.5/2/2.5/3/4/5/7.5/10 × 10^n), so data peaking at 5 gets an axis top of 5 and data peaking at 7 gets 7.5.

How is text width measured without a font-metrics API?

It is estimated, not measured: CJK characters and emoji count as one character width, everything else as 0.55, multiplied by the font size. Because the estimate is font-independent, the same data produces byte-identical SVG in Node tests and in the browser, which is what makes the output assertable; the trade-off is that very narrow or very wide fonts may render slightly differently.

Is my data uploaded?

No. Everything is drawn locally in the browser with no network requests and it works offline; the generated SVG references no external resources (fonts are a font-family list and colours are hard-coded hex).

Can I preview and export a PNG right on the page?

Yes. The result card renders a live preview that redraws with the options; “Export SVG” downloads the .svg source file and “Export PNG” draws the same SVG onto a canvas and exports a PNG at the configured canvas size (720 × 420 by default). Rasterisation happens locally — nothing is uploaded and no server is involved.

Keywords:chart maker

Related tools