diff --git a/package.json b/package.json index b9f0a443a..4178145b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dc", - "version": "2.0.0-beta.25", + "version": "2.0.0-beta.26", "license": "Apache-2.0", "copyright": "2014", "description": "A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js ", diff --git a/src/pie-chart.js b/src/pie-chart.js index c8a5cfa75..fb460cfb6 100644 --- a/src/pie-chart.js +++ b/src/pie-chart.js @@ -155,12 +155,8 @@ dc.pieChart = function (parent, chartGroup) { } } - function positionLabels (labelsEnter, arc) { - dc.transition(labelsEnter, _chart.transitionDuration()) - .attr('transform', function (d) { - return labelPosition(d, arc); - }) - .attr('text-anchor', 'middle') + _chart._applyLabelText = function (labels) { + labels .text(function (d) { var data = d.data; if ((sliceHasNoData(data) || sliceTooSmall(d)) && !isSelectedSlice(d)) { @@ -168,6 +164,15 @@ dc.pieChart = function (parent, chartGroup) { } return _chart.label()(d.data); }); + }; + + function positionLabels (labels, arc) { + _chart._applyLabelText(labels); + dc.transition(labels, _chart.transitionDuration()) + .attr('transform', function (d) { + return labelPosition(d, arc); + }) + .attr('text-anchor', 'middle'); } function createLabels (pieData, arc) {