0.7.0 • Published 17 days ago

awesome-chart v0.7.0

Weekly downloads
-
License
MIT
Repository
-
Last release
17 days ago

Awesome Chart · npm version

Awesome Chart is a lightweight 2d chart library. It should be noted that the use of the framework is greater than the use of the chart library.

Installation

npm install awesome-chart
yarn add awesome-chart

Documents

  1. Some basic concepts of chart.
  2. How charts lay out content.
  3. How charts work with data.

Examples

There are several examples on the website. Awesome Chart supports two ways of writing.

For command style

import {Chart, DataBase} from 'awesome-chart'

const chart = new Chart({
  engine: 'svg',
  adjust: false,
  width: 200,
  height: 200,
  padding: [24, 24, 24, 24],
  container: document.body,
})

const textLayer = chart.createLayer({
  id: 'title',
  type: 'text',
  layout: chart.layout.main,
})

textLayer?.setData(new DataBase('This is a text'))
textLayer?.setStyle({
  text: {
    fill: 'red',
    fontSize: 24,
  },
})

chart.draw()

For declarative style

import {createChart} from 'awesome-chart'

createChart({
  engine: 'svg',
  adjust: false,
  width: 200,
  height: 200,
  padding: [24, 24, 24, 24],
  container: document.body,
  layers: [
    {
      type: 'text',
      options: {
        id: 'title',
        layout: 'main',
      },
      data: 'This is a text',
      style: {
        text: {
          fill: 'red',
          fontSize: 24,
        },
      },
    },
  ],
})
0.7.0

17 days ago

0.6.4

18 days ago

0.6.3

7 months ago

0.4.5

9 months ago

0.6.2

7 months ago

0.4.4

9 months ago

0.5.0

9 months ago

0.6.1

8 months ago

0.4.3

10 months ago

0.6.0

9 months ago

0.4.2

11 months ago

0.4.1

12 months ago

0.4.0

12 months ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.0

2 years ago