1.3.0 • Published 10 years ago

canvas-chart v1.3.0

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

Canvas chart

Takes an array of data points, makes a canvas of it and save as a PNG

Installation

npm install canvas-chart --save-dev

Graph types

The implemented graph types

  • Line

Standard settings

{
    filename: 'public/out',
    grid: true,
    height: 450,
    lineWidth: 3,
    points: true,
    pointFill: '#fff',
    pointStroke: '#000',
    stroke: true,
    strokeColor: '#000',
    type: 'line',
    width: 800
}

Use

  var chart = require('canvas-chart');
  var data = [10, 20, 30, 60];

  chart.graph(data, {
    filename: 'movies',
    fillColor: 'rgba(12, 165, 176, 1)'
  });
  

This writes a .png at public/movies.png that looks like this:

Movies

1.3.0

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago