Skip to content

Commit

Permalink
Fix line animation from empty data to number data
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 13, 2016
1 parent 4412d51 commit db7df2a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/chart/line/lineAnimationDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ define(function (require) {
// Which is in case remvoing or add more than one data in the tail or head
switch (diffItem.cmd) {
case '=':
currPoints.push(oldData.getItemLayout(diffItem.idx));
nextPoints.push(newData.getItemLayout(diffItem.idx1));
var currentPt = oldData.getItemLayout(diffItem.idx);
var nextPt = newData.getItemLayout(diffItem.idx1);
// If previous data is NaN, use next point directly
if (isNaN(currentPt[0]) || isNaN(currentPt[1])) {
currentPt = nextPt.slice();
}
currPoints.push(currentPt);
nextPoints.push(nextPt);

currStackedPoints.push(oldStackedOnPoints[diffItem.idx]);
nextStackedPoints.push(newStackedOnPoints[diffItem.idx1]);
Expand Down

0 comments on commit db7df2a

Please sign in to comment.