# Generate a Chart from CSV

Paste CSV data and generate a bar, line, scatter, or histogram chart as a clean, scalable SVG — in your browser, nothing uploaded. Pick columns, colors, and size.

## Run it

- **CLI:** `gizza tool csv-chart-generator "month,revenue
Jan,1200
Feb,1800
Mar,1500
Apr,2400
May,2100" 'y_column=revenue'`
- **Web:** https://gizza.ai/tools/csv-chart-generator/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/csv-chart-generator/tool.json

## Inputs

- `data` — CSV data _(field)_
- `chart_type` — Chart type _(field)_
- `x_column` — X column (header name or 1-based index) _(field)_
- `y_column` — Y column (numeric; the binned column for a histogram) _(field)_
- `title` — Chart title (optional) _(field)_
- `width` — Width (px) _(field)_
- `height` — Height (px) _(field)_
- `color` — Series color (any CSS color) _(field)_
- `bins` — Histogram bins (2–100) _(field)_

## Output

- Chart SVG (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `data` — CSV data
- `chart_type` — Chart type
- `x_column` — X column (header name or 1-based index)
- `y_column` — Y column (numeric; the binned column for a histogram)
- `title` — Chart title (optional)
- `width` — Width (px)
- `height` — Height (px)
- `color` — Series color (any CSS color)
- `bins` — Histogram bins (2–100)

Example: `https://gizza.ai/tools/csv-chart-generator/?data=month%2Crevenue%0AJan%2C1200%0AFeb%2C1800%0AMar%2C1500%0AApr%2C2400%0AMay%2C2100&chart_type=bar&x_column=month&y_column=revenue&title=Monthly%20revenue&width=800&height=400&color=%232563eb&bins=10`

---

## Turn CSV columns into a clean SVG chart

Paste a small CSV table, choose the columns to plot, and generate a standalone SVG chart you can copy, save, or drop into documentation. The tool supports **bar charts**, **line charts**, **scatter plots**, and **histograms**. Header names are matched case-insensitively; if your CSV has no header row, use 1-based column indexes such as `1` and `2`.

### Worked example

Input:

```csv
month,revenue
Jan,1200
Feb,1800
Mar,1500
Apr,2400
May,2100
```

Use **Chart type** = `bar`, **X column** = `month`, **Y column** = `revenue`, and **Chart title** = `Monthly revenue`. The output SVG draws labeled axes, one bar per month, and a title. Switch to `line` for a trend line, `scatter` for numeric X/Y pairs, or `histogram` to bin one numeric column.

## FAQ

<details>
<summary>What chart types can I create?</summary>

You can render bar charts for categorical X values, line charts for ordered or numeric X values, scatter plots for numeric X/Y pairs, and histograms that bin one numeric column. Each output is a plain SVG string with no external dependencies.

</details>

<details>
<summary>How do I choose columns?</summary>

If the first row is a header, enter the header name exactly or case-insensitively, such as `month` or `revenue`. If the CSV has no header row, use 1-based indexes: `1` for the first column, `2` for the second, and so on.

</details>

<details>
<summary>Why do some values get skipped?</summary>

Rows with missing or non-numeric values in numeric columns are skipped because SVG coordinates require numbers. The chart still renders as long as at least one valid point or bin remains; otherwise the tool returns a clear error.

</details>

<details>
<summary>Is my CSV uploaded anywhere?</summary>

No. CSV parsing and SVG generation run locally in WebAssembly. The chart is generated in your browser, and your data is not sent to a server.

</details>

## Related tools

- [Avro to JSON Converter](https://gizza.ai/tools/avro-to-json/): Decode Apache Avro Object Container Files (.avro / OCF) to JSON, NDJSON, or the embedded schema — no .avsc needed, free and private in your browser.
- [Bencode decoder](https://gizza.ai/tools/bencode-decoder/): Decode bencode (the BitTorrent / .torrent serialization format) into readable JSON, and re-encode JSON back into canonical bencode — in your browser. Nothing is uploaded.
- [CAMT.053 Statement Parser](https://gizza.ai/tools/camt053-parse/): Parse a camt.053 (or camt.052/054) ISO 20022 bank statement XML into JSON or CSV in your browser: balances, dates, counterparties, references. No upload.
- [CSV Cell Diff](https://gizza.ai/tools/csv-cell-diff/): Compare two CSVs column-by-column and highlight every individual cell that changed, plus added and removed rows and columns.
- [Change CSV Delimiter](https://gizza.ai/tools/csv-change-delimiter/): Re-save CSV or delimited data with a different separator (comma, tab, semicolon, pipe) with correct requoting — in your browser. Free, private, no upload.
