【发布时间】:2015-03-11 13:24:32
【问题描述】:
这是我目前的 nvd3 饼图
如您所见,我在饼图的顶部有所有标签(由红色框 1 表示)。 我要做的是将这些标签的位置移到饼图的底部(由红色框2表示)。
这是我的 nvd3 代码,我用它来创建这个饼图。
function graphDataStatsChart(sourceData) {
nv.addGraph(function() {
var chart = nv.models.pieChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.showLabels(true) //Display pie labels
.labelThreshold(.05) //Configure the minimum slice size for labels to show up
.labelType("percent") //Configure what type of data to show in the label. Can be "key", "value" or "percent"
.donut(true) //Turn on Donut mode. Makes pie chart look tasty!
.donutRatio(0.35) //Configure how big you want the donut hole size to be.
;
d3.select("#chart1 svg")
.datum(sourceData)
.transition().duration(350)
.call(chart);
return chart;
});
};
任何机构都可以提出一种方法来进行上述重新定位吗?
【问题讨论】: