# tiny-spark
[](https://github.com/graphieros/tiny-spark)
[](https://github.com/graphieros/tiny-spark/issues)
[](https://github.com/graphieros/tiny-spark?tab=MIT-1-ov-file#readme)
[](https://github.com/graphieros/tiny-spark)
An elegant, reactive and responsive sparkline chart solution without dependency.
[DEMO](https://tiny-spark.graphieros.com/)
## Installation
```
npm i tiny-spark
```
## Usage
Import the file in your project:
```js
import { render } from "tiny-spark";
// If you need to fetch data, call render afterwards
getData().then(render);
// If you hardcode your dataset, you can call render immediately
```
Calling render again will re-trigger the animation (if data-animation is set to "true").
Just set up a div with a "tiny-spark" class, with a few data attributes to configure the chart.
Note that providing data-id is optional, a unique id will be generated if you don't.
Render a line chart:
```html