diff --git a/src/component/axis/AngleAxisView.js b/src/component/axis/AngleAxisView.js index 90678b4240..5fd14eeae6 100644 --- a/src/component/axis/AngleAxisView.js +++ b/src/component/axis/AngleAxisView.js @@ -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); + } + } }, /** diff --git a/src/coord/polar/polarCreator.js b/src/coord/polar/polarCreator.js index d8f93e85df..9c45256179 100644 --- a/src/coord/polar/polarCreator.js +++ b/src/coord/polar/polarCreator.js @@ -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]); } /**