Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
nChart for node.js inspired by Chart.js.
JavaScript Makefile
Branch: master

fix link

latest commit b8cd977c00
@fundon authored
Failed to load latest commit information.
examples 1.0.1
lib Remove require('canvas')
test update Makefile
.gitignore ignore .node-version
.npmignore udpate Readme.md
Chart.js use latest Chart.js, #6
History.md update history
LICENSE updated license
Makefile show values in `Doughnut Chart` and `Pie Chart`
README.md fix link
index.js use latest Chart.js, #6
package.json 1.0.1

README.md

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

Something went wrong with that request. Please try again.