chartjs-custom

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i chartjs-custom

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • haruthuc