0.0.2 • Published 11 years ago
diy-donutchart v0.0.2
diy-donutchart
Render a donut chart using d3.
example
Let's render a donut chart! MMMM!
var donutchart = require('diy-donutchart');
var target = document.getElementById('donut-chart');
var data = {
percent: 0.2
};
var options = {
color: '#34a2d8',
size: 160,
thickness: 20
};
donutchart(target, data, options);methods
var donutchart = require('diy-donutchart');donutchart($el, data, options)
Appends a svg element to $el.
$el is the target element. data should be an object with a percent
property.
Options can contain:
color of the positive ring (background is light gray).
size is the width and height of the donut.
thickness adjusts the thickness of the donut ring.
{
color: '#34a2d8',
size: 160,
thickness: 20
}license
APACHE 2.0
