dchart-pie-multi-rank
v0.0.2
Published
dchart-pie-multi-rank
Downloads
2
Readme
dchart-pie-multi-rank
符合dchart规范的多维饼图排行榜
安装
npm install dchart-pie-multi-rank
用法
var Pie = require('dchart-pie-multi-rank');
var pie = new Pie(container, {
margin : {left: 30, top:15, right:40, bottom:30},
arc : {
start: 0, //起始角度
end: 2 * Math.PI / 4 //终止角度
},
pyaxis: {
key: 'size'
},
size: 4, //只取排行榜前4名
paxis: {
key: 'name',
label : function (d, i) {
return '<tspan dy="0">' + d.name + '</tspan><tspan x="0" y="1em">' + d.size + '</tspan>';
}
},
index: { //显示排名序列
show: true
}
});
pie.render([
{'name': '收入', data: [
{'name': '杭州', 'size': 5800},
{'name': '湖州', 'size': 5000},
{'name': '宁波', 'size': 4700},
{'name': '嘉兴', 'size': 4500},
{'name': '温州', 'size': 3700}]
},
{'name': '税收', data: [
{'name': '杭州', 'size': 5800},
{'name': '湖州', 'size': 5000},
{'name': '宁波', 'size': 4700},
{'name': '嘉兴', 'size': 4500},
{'name': '温州', 'size': 3700}]
}
]);