Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including lovely-chart with all npm packages installed. Try it out:

var lovelyChart = require("lovely-chart")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

lovely-chart v1.0.0

LovelyChart

🏆 A Telegram Chart Contest 2019 award winning library.

mobile friendly, high performance, extra lightweight, zero dependency, production ready, open source

lightweight chart js library

Demo

https://ajaxy.github.io/lovely-chart/

Usage

import * as LovelyChart from 'lovely-chart';
import '~/lovely-chart/dist/LovelyChart.css';

LovelyChart.create(container, data);

Arguments for LovelyChart.create

  • container — DOM Node in which the chart is rendered. The chart layout resizes automatically to occupy the entire available width.
  • data — Parameters for a chart.
ParameterDescription
titleChart headline
typeChart type. Supported types: line, area, bar, pie
labelsArray of UNIX timestamps in milliseconds
datasetsArray of params for each dataset
datasets[*].nameDataset name
datasets[*].colorDataset color
datasets[*].valuesArray of dataset values
isPercentagetrue for percentage based values
isStackedtrue for values stacking on top of each other
hasSecondYAxistrue for charts with 2 Y axes
onZoomOptional function which returns Promise with data for the zoomed chart (new data object)
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free