提交 e208f5df 编写于 作者: C cuijian-dexter 提交者: Ovilia

funnel enhance--series.label.position (#9421)

* New Feature--series.label.position  add rightTop,rightBottom,leftTop,leftBottom

* style: fix style in funnel text position
上级 502aee66
......@@ -104,7 +104,47 @@ function labelLayout(data) {
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
}
else if (labelPosition === 'right') {
// Right side
x1 = (points[1][0] + points[2][0]) / 2;
y1 = (points[1][1] + points[2][1]) / 2;
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'left';
}
else if (labelPosition === 'rightTop') {
// RightTop side
x1 = points[1][0];
y1 = points[1][1];
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'top';
}
else if (labelPosition === 'rightBottom') {
// RightBottom side
x1 = points[2][0];
y1 = points[2][1];
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'bottom';
}
else if (labelPosition === 'leftTop') {
// LeftTop side
x1 = points[0][0];
y1 = points[1][1];
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
else if (labelPosition === 'leftBottom') {
// LeftBottom side
x1 = points[3][0];
y1 = points[2][1];
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
else {
// Right side
x1 = (points[1][0] + points[2][0]) / 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册