GithubHelp home page GithubHelp logo

arraycto / lw-chart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ad-feiben/lw-chart

0.0 0.0 0.0 1.45 MB

a lightweight chart implemented by canvas.

Home Page: https://www.fedevelop.cn/lw-chart-docs/docs/

License: MIT License

JavaScript 12.76% HTML 0.68% TypeScript 86.56%

lw-chart's Introduction

lw-chart

lw-chart

A lightweight chart implemented by canvas.

license

Install

$ npm i lw-chart

Usage

// import { Area } from 'lw-chart';
import Area from 'lw-chart/dist/Area.js';

const xAxisData = [ '5-01', '5-02', '5-03', '5-04', '5-05', '5-06', '5-07' ];
const yAxisData = [ [ 2, 5, 7, 10, 6, 8, 12 ] ];

const baseConfig = {
  title: 'Line Mode',
  canvasPadding: [10, 30, 10, 20],
  chartPadding: [10],
  canvasBg: '#f2f2f2',
  chartBg: '#fff',
  areaLineColor: ['rgba(255, 71, 87,1.0)'],
  areaDotStorkColor: ['rgba(255, 71, 87,1.0)'],
  areaActiveDotFillColor: ['rgba(255, 71, 87,.3)'],
  areaStartColor: ['rgba(0, 0, 0, 0)'],
  areaEndColor: ['rgba(0, 0, 0, 0)'],
  yAxisFormat: (val) => {
    return val.toFixed(2);
  }
};

const lineChart = new Area(document.querySelector('.line-chart'), baseConfig);
lineChart.updateData(xAxisData, yAxisData);

Document

Document

Demo

Demo

Official Account

微信公众号【前端develop】

前端develop

lw-chart's People

Contributors

ad-feiben avatar authentic-feiben avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.