# SPARKLINE

utility · from google sheets · no excel equivalent · sheets: differs in detail

draws a mini line or bar chart from a range — options take charttype, color, negcolor, linewidth, ymin and ymax

## signature

```
SPARKLINE(data, [options])
```

returns: `svg`

## arguments

- data: range — required
- options: any — optional

## examples

formula and result, asserted in the engine test suite.

| formula | result | with |
| --- | --- | --- |
| `=SPARKLINE(A1:A4)` | `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" preserveAspectRatio="none"><polyline fill="none" stroke="currentColor" stroke-width="1" points="0.00,14.50 33.33,10.00 66.67,5.50 100.00,1.00"/></svg>` | A1=10, A2=20, A3=30, A4=40 |

## related

- [FROMBYTES](https://deepcalc.com/functions/frombytes.md) — converts byte array to integer
- [GENERATEID](https://deepcalc.com/functions/generateid.md) — generates unique ID with prefix and random suffix
- [HASH](https://deepcalc.com/functions/hash.md) — hex digest of text: SHA256 (default, FIPS 180-4) or MD5 (RFC 1321)
- [IMAGE](https://deepcalc.com/functions/image.md) — shows an image from a url — the browser loads it, the engine does not fetch
- [ISIN](https://deepcalc.com/functions/isin.md) — checks if value is in a range or comma-separated list
- [RANDOMCHOICE](https://deepcalc.com/functions/randomchoice.md) — random pick from a range (with replacement); count > 1 spills a column
- [RANDOMINT.UNIQUE](https://deepcalc.com/functions/randomint-unique.md) — generates unique random integers in range
- [RANDOMNORMAL](https://deepcalc.com/functions/randomnormal.md) — generates random values from normal distribution

## navigate

- [all utility functions](https://deepcalc.com/functions/utility-functions.md)
- [function index](https://deepcalc.com/functions.md) — all 600 functions
- [error values](https://deepcalc.com/errors.md) · [concepts](https://deepcalc.com/concepts.md) · [limits](https://deepcalc.com/limits.md)
- [everything in one file](https://deepcalc.com/llms-full.txt)

source: https://deepcalc.com/functions/sparkline