提交 b5e6ba7e 编写于 作者: O Ovilia

feat(polar): supports radius array for polar

上级 e50f0498
......@@ -96,19 +96,24 @@ export default AxisView.extend({
_axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle');
var circle = new graphic.Circle({
shape: {
cx: polar.cx,
cy: polar.cy,
r: radiusExtent[getRadiusIdx(polar)]
},
style: lineStyleModel.getLineStyle(),
z2: 1,
silent: true
});
circle.style.fill = null;
this.group.add(circle);
for (var rx = 0; rx < radiusExtent.length; ++rx) {
// Draw a circle for radius like [0, 100], and two circles for [20, 100]
if (radiusExtent[rx] > 0) {
var circle = new graphic.Circle({
shape: {
cx: polar.cx,
cy: polar.cy,
r: radiusExtent[rx]
},
style: lineStyleModel.getLineStyle(),
z2: 1,
silent: true
});
circle.style.fill = null;
this.group.add(circle);
}
}
},
/**
......
......@@ -47,10 +47,23 @@ function resizePolar(polar, polarModel, api) {
var radiusAxis = polar.getRadiusAxis();
var size = Math.min(width, height) / 2;
var radius = parsePercent(polarModel.get('radius'), size);
var radius = polarModel.get('radius');
if (radius == null) {
radius = [0, "100%"];
}
else if (typeof radius === 'number' || typeof radius === 'string') {
// r0 = 0
radius = [0, radius];
}
radius = [
parsePercent(radius[0], size),
parsePercent(radius[1], size)
];
radiusAxis.inverse
? radiusAxis.setExtent(radius, 0)
: radiusAxis.setExtent(0, radius);
? radiusAxis.setExtent(radius[1], radius[0])
: radiusAxis.setExtent(radius[0], radius[1]);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册