Skip to content

Commit

Permalink
bug fixed of last data
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Nov 10, 2014
1 parent 633f981 commit 3246aa6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/chart/funnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ define(function (require) {
var centerX = location.centerX;
var pointList= [];
var x;
var polygon
var lastPolygon;
for (var i = 0, l = selectedData.length; i < l; i++) {
itemName = selectedData[i].name;
Expand All @@ -137,15 +138,15 @@ define(function (require) {
default:
x = centerX - lastWidth / 2;
}
lastPolygon = this._buildItem(
polygon = this._buildItem(
seriesIndex, selectedData[i]._index,
legend // color
? legend.getColor(itemName)
: this.zr.getColor(selectedData[i]._index),
x, lastY, lastWidth, width, height, align
);
lastY += height + gap;
lastPolygon = lastPolygon.style.pointList;
lastPolygon = polygon.style.pointList;

pointList.unshift([lastPolygon[0][0] - 10, lastPolygon[0][1]]); // 左
pointList.push([lastPolygon[1][0] + 10, lastPolygon[1][1]]); // 右
Expand All @@ -155,6 +156,9 @@ define(function (require) {
align == 'center' && (pointList[0][0] += 10);
align == 'right' && (pointList[0][0] = lastPolygon[0]);
pointList[0][1] -= align == 'center' ? 10 : 15;
if (l == 1) {
lastPolygon = polygon.style.pointList;
}
}
else {
pointList[pointList.length - 1][1] -= 5;
Expand All @@ -164,6 +168,7 @@ define(function (require) {
lastWidth = width;
}
}

if (funnelCase) {
pointList.unshift([lastPolygon[3][0] - 10, lastPolygon[3][1]]); // 左
pointList.push([lastPolygon[2][0] + 10, lastPolygon[2][1]]); // 右
Expand Down

0 comments on commit 3246aa6

Please sign in to comment.