diff --git a/src/component/axis/AngleAxisView.ts b/src/component/axis/AngleAxisView.ts index a694c4e491..10250136df 100644 --- a/src/component/axis/AngleAxisView.ts +++ b/src/component/axis/AngleAxisView.ts @@ -138,23 +138,32 @@ interface AngleAxisElementBuilder { const angelAxisElementsBuilders: Record = { axisLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + const axisLineModel = angleAxisModel.getModel('axisLine'); const lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); const angleAxis = polar.getAngleAxis(); + const radiusAxis = polar.getRadiusAxis(); const RADIAN = Math.PI / 180; const angleExtent = angleAxis.getExtent(); - - // extent id of the axis radius (r0 and r) - const rId = getRadiusIdx(polar); - const r0Id = rId ? 0 : 1; - let shape; + const showMinLine = axisLineModel.get('showMinLine') !== false; + const showMaxLine = axisLineModel.get('showMaxLine') !== false; const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc'; + const radiusDataExtent = radiusAxis.scale.getExtent(); + const minRadius = radiusAxis.dataToCoord(radiusDataExtent[0]); + const maxRadius = radiusAxis.dataToCoord(radiusDataExtent[1]); - if (radiusExtent[r0Id] === 0) { - shape = new graphic[shapeType]({ + if (!showMinLine && !showMaxLine) { + return; + } + + const addBoundaryLine = (radius: number) => { + if (!isFinite(radius)) { + return; + } + const shape = new graphic[shapeType]({ shape: { cx: polar.cx, cy: polar.cy, - r: radiusExtent[rId], + r: Math.max(radius, 0), startAngle: -angleExtent[0] * RADIAN, endAngle: -angleExtent[1] * RADIAN, clockwise: angleAxis.inverse @@ -163,22 +172,21 @@ const angelAxisElementsBuilders: Record & { + showMinLine?: boolean; + showMaxLine?: boolean; + } }; export type RadiusAxisOption = AxisBaseOption & { @@ -86,4 +90,4 @@ export class RadiusAxisModel extends PolarAxisModel { static type = 'radiusAxis'; type = RadiusAxisModel.type; axis: RadiusAxis; -} \ No newline at end of file +} diff --git a/test/axis-axisLine.html b/test/axis-axisLine.html new file mode 100644 index 0000000000..aa9f0569c6 --- /dev/null +++ b/test/axis-axisLine.html @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + diff --git a/test/axis-splitLine.html b/test/axis-splitLine.html index 2dfd1a320d..f9cb31ec09 100644 --- a/test/axis-splitLine.html +++ b/test/axis-splitLine.html @@ -34,50 +34,143 @@ -
+
+
+
+
-