提交 c80bb99c 编写于 作者: O Ovilia

refactor(rotate):

上级 e0a8e7e2
......@@ -186,19 +186,17 @@ SunburstPieceProto._updateLabel = function (seriesModel, ecModel) {
var textY = (layout.r + layout.r0) / 2 * dy + layout.cy;
label.attr('position', [textX, textY]);
var rotate = labelModel.getShallow('rotate');
if (rotate === 'radial') {
var rotateType = labelModel.getShallow('rotate');
var rotate = 0;
if (rotateType === 'radial') {
rotate = -midAngle;
if (rotate < -Math.PI / 2) {
rotate += Math.PI;
}
}
else if (rotate === 'tangential') {
else if (rotateType === 'tangential') {
rotate = Math.PI / 2 - midAngle;
}
else {
rotate = 0;
}
label.attr('rotation', rotate);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册