1.0.2 • Published 8 years ago

chartjs-custom v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

chartjs-custom

The fork version of nChart

Usage

var Canvas = require('canvas')
  , canvas = new Canvas(800, 800)
  , ctx = canvas.getContext('2d')
  , Chart = require('nchart-custom')
  , fs = require('fs');
 
new Chart(ctx).Doughnut(
    [
        {
            "value": 50,
            "color": "#27ae60",
          "showCenterText":true,
          "showCenterLabel":true,
          "label":"Compliance"
        },
        {
            "value": 100,
            "color": "#D4CCC5",
            "label":"Non-compliance",
            "color": "#F7464A"
        }
    ]
  , {
        scaleShowValues: true,
        percentageInnerCutout : 75,
         scaleFontSize: 24
    }
);
 
canvas.toBuffer(function (err, buf) {
  if (err) throw err;
  fs.writeFile(__dirname + '/pie2.png', buf);
});

Installation

$ npm install -g chartjs-custom

Required!

Documentation

You can find documentation at Chart.js Doc

Thanks to

License

MIT

1.0.2

8 years ago

1.0.1

8 years ago