Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lite-chart

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lite-chart

Lightweight SVG chart generator.

  • 0.1.0-rc.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Lite Chart

NPM

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

  npm install lite-chart

  #or

  yarn add lite-chart

Usage

Lite Chart
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

Changelog

v0.1.0-rc.1
  • Release candidate 1 released.

Keywords

FAQs

Package last updated on 20 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc