Skip to content

Commit

Permalink
udpate Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed May 25, 2013
1 parent 8947661 commit 6f5c050
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples/*.png
34 changes: 34 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@ nchart

nChart for node.js inspired by [Chart.js][].

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

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
Expand Down

0 comments on commit 6f5c050

Please sign in to comment.