Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.dimension(dimension)
.group(group);
chart.legend(dc.legend().legendText(function(d) {
return d.name + ' (' + d.data + ')';
}).x(0).y(20))
chart.on('renderlet', function(chart) {
chart.selectAll('text.pie-slice')
.attr('transform', function(d) {
var translate = d3.select(this).attr('transform');
var ang = ((d.startAngle + d.endAngle) / 2 * 180 / Math.PI) % 360;
if (ang < 180) ang -= 90;
else ang += 90;
return translate + ' rotate(' + ang + ')';
});
});
dc.override(chart, 'legendables', function() {
var legendables = this._legendables();
return legendables.filter(function(l) {
return l.data > 0;
});
});
return chart;
}