Skip to content

HabitRPG/nchart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: forked by @paglias to allow chart.destroy(), used in habitrpg-email-server repo

nchart

nchart for node.js inspired by [Chart.js][].
NOTE: nchart currently just imports Chart.js(v1.x) and it's hacked for node.

Usage

var Canvas = require('canvas')
  , canvas = new Canvas(800, 800)
  , ctx = canvas.getContext('2d')
  , Chart = require('nchart')
  , fs = require('fs');

new Chart(ctx).Pie(
    [
        {
            "value": 50
          , "color": "#E2EAE9"
        }
      , {
            "value": 100
          , "color": "#D4CCC5"
        }
      , {
            "value": 40
          , "color": "#949FB1"
        }
    ]
  , {
        scaleShowValues: true
      , scaleFontSize: 24
    }
);

canvas.toBuffer(function (err, buf) {
  if (err) throw err;
  fs.writeFile(__dirname + '/pie.png', buf);
});

Installation

$ npm install -g nchart

Required!

Documentation

You can find documentation at Chart.js Doc

Thanks to

License

MIT

About

nChart for node.js inspired by Chart.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Makefile 0.2%