# lite-chart

> Lightweight SVG chart generator.

Latest version **0.1.0-rc.1** (published 2021-12-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install lite-chart
pnpm add lite-chart
yarn add lite-chart
bun add lite-chart
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-rc.1 |
| Published | 2021-12-20 |
| First published | 2021-12-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | CagriAldemir |
| Maintainers | cagrialdemir |
| Keywords | lightweight, svg, chart |

## Links

- npm: https://www.npmjs.com/package/lite-chart
- Repository: https://github.com/CagriAldemir/lite-chart
- Homepage: https://github.com/CagriAldemir/lite-chart#readme
- Issues: https://github.com/CagriAldemir/lite-chart/issues
- npm.io page: https://npm.io/package/lite-chart

## Dependencies (1)

- [xml](https://npm.io/package/xml.md) ^1.0.1

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.1.0-rc.1 (latest) — 2021-12-20

## README

# Lite Chart

[![NPM](https://img.shields.io/npm/v/lite-chart.svg)](https://www.npmjs.com/package/lite-chart)

Lite Chart is an SVG generating library. When you provide the necessary configuration and data according to the chart types in it, it creates SVG charts suitable for the data.

## Installation

```bash
  npm install lite-chart

  #or

  yarn add lite-chart
```

## Usage

#### Lite Chart

```typescript
import { LineChart, LineChartConfig } from 'lite-chart';

const lineChartConfig: LineChartConfig = {
  height: 110,
  width: 300,
  padding: 5,
  strokeThickness: 2,
  strokeColor: '#3AD09F',
  gradient: [
    {
      offset: '0%',
      stopOpacity: '0.25',
      stopColor: '#3AD09F',
    },
    {
      offset: '100%',
      stopOpacity: '0',
      stopColor: '#3AD09F',
    },
  ],
};

const RANDOM_DATA = Array.from({ length: 24 }, () =>
  Math.floor(Math.random() * 1000)
);

const lineChart = new LineChart(lineChartConfig);

const imageSource = lineChart.getImageSource(RANDOM_DATA);
console.log(imageSource);

const svgString = lineChart.getSvgString(RANDOM_DATA);
console.log(svgString);

// If it is a node project
lineChart.saveAsFile(RANDOM_DATA, './charts/example.svg');
```

## Screenshots

#### Lite Chart

![Lite Chart](https://i.ibb.co/4tYbK9m/line-chart.png)

## Changelog

#### v0.1.0-rc.1

- Release candidate 1 released.

---
_Source: https://npm.io/package/lite-chart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
