Skip to content

Commit

Permalink
Merge pull request #1695 from jessenieminen/master
Browse files Browse the repository at this point in the history
[Bug fix #1474, pieChart] Implemented duration for pieChart
  • Loading branch information
liquidpele authored Jul 3, 2016
2 parents e7090bd + d409b02 commit ad497ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/models/pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ nv.models.pie = function() {
, endAngle = false
, cornerRadius = 0
, donutRatio = 0.5
, duration = 250
, arcsRadius = []
, dispatch = d3.dispatch('chartClick', 'elementClick', 'elementDblClick', 'elementMouseover', 'elementMouseout', 'elementMousemove', 'renderEnd')
;
Expand Down Expand Up @@ -210,6 +211,7 @@ nv.models.pie = function() {

slices.select('path')
.transition()
.duration(duration)
.attr('d', function (d, i) { return arcs[i](d); })
.attrTween('d', arcTween);

Expand Down Expand Up @@ -414,6 +416,10 @@ nv.models.pie = function() {
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
}},
duration: {get: function(){return duration;}, set: function(_){
duration = _;
renderWatch.reset(duration);
}},
y: {get: function(){return getY;}, set: function(_){
getY=d3.functor(_);
}},
Expand Down
1 change: 1 addition & 0 deletions src/models/pieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ nv.models.pieChart = function() {
duration: {get: function(){return duration;}, set: function(_){
duration = _;
renderWatch.reset(duration);
pie.duration(duration);
}},
margin: {get: function(){return margin;}, set: function(_){
margin.top = _.top !== undefined ? _.top : margin.top;
Expand Down

0 comments on commit ad497ff

Please sign in to comment.