@@ -138,23 +138,32 @@ interface AngleAxisElementBuilder {
138138const angelAxisElementsBuilders : Record < typeof elementList [ number ] , AngleAxisElementBuilder > = {
139139
140140 axisLine ( group , angleAxisModel , polar , ticksAngles , minorTickAngles , radiusExtent ) {
141+ const axisLineModel = angleAxisModel . getModel ( 'axisLine' ) ;
141142 const lineStyleModel = angleAxisModel . getModel ( [ 'axisLine' , 'lineStyle' ] ) ;
142143 const angleAxis = polar . getAngleAxis ( ) ;
144+ const radiusAxis = polar . getRadiusAxis ( ) ;
143145 const RADIAN = Math . PI / 180 ;
144146 const angleExtent = angleAxis . getExtent ( ) ;
145-
146- // extent id of the axis radius (r0 and r)
147- const rId = getRadiusIdx ( polar ) ;
148- const r0Id = rId ? 0 : 1 ;
149- let shape ;
147+ const showMinLine = axisLineModel . get ( 'showMinLine' ) !== false ;
148+ const showMaxLine = axisLineModel . get ( 'showMaxLine' ) !== false ;
150149 const shapeType = Math . abs ( angleExtent [ 1 ] - angleExtent [ 0 ] ) === 360 ? 'Circle' : 'Arc' ;
150+ const radiusDataExtent = radiusAxis . scale . getExtent ( ) ;
151+ const minRadius = radiusAxis . dataToCoord ( radiusDataExtent [ 0 ] ) ;
152+ const maxRadius = radiusAxis . dataToCoord ( radiusDataExtent [ 1 ] ) ;
151153
152- if ( radiusExtent [ r0Id ] === 0 ) {
153- shape = new graphic [ shapeType ] ( {
154+ if ( ! showMinLine && ! showMaxLine ) {
155+ return ;
156+ }
157+
158+ const addBoundaryLine = ( radius : number ) => {
159+ if ( ! isFinite ( radius ) ) {
160+ return ;
161+ }
162+ const shape = new graphic [ shapeType ] ( {
154163 shape : {
155164 cx : polar . cx ,
156165 cy : polar . cy ,
157- r : radiusExtent [ rId ] ,
166+ r : Math . max ( radius , 0 ) ,
158167 startAngle : - angleExtent [ 0 ] * RADIAN ,
159168 endAngle : - angleExtent [ 1 ] * RADIAN ,
160169 clockwise : angleAxis . inverse
@@ -163,22 +172,21 @@ const angelAxisElementsBuilders: Record<typeof elementList[number], AngleAxisEle
163172 z2 : 1 ,
164173 silent : true
165174 } ) ;
175+ shape . style . fill = null ;
176+ group . add ( shape ) ;
177+ } ;
178+
179+ if ( Math . abs ( minRadius - maxRadius ) < 1e-4 ) {
180+ addBoundaryLine ( minRadius ) ;
181+ return ;
166182 }
167- else {
168- shape = new graphic . Ring ( {
169- shape : {
170- cx : polar . cx ,
171- cy : polar . cy ,
172- r : radiusExtent [ rId ] ,
173- r0 : radiusExtent [ r0Id ]
174- } ,
175- style : lineStyleModel . getLineStyle ( ) ,
176- z2 : 1 ,
177- silent : true
178- } ) ;
183+
184+ if ( showMinLine ) {
185+ addBoundaryLine ( minRadius ) ;
186+ }
187+ if ( showMaxLine ) {
188+ addBoundaryLine ( maxRadius ) ;
179189 }
180- shape . style . fill = null ;
181- group . add ( shape ) ;
182190 } ,
183191
184192 axisTick ( group , angleAxisModel , polar , ticksAngles , minorTickAngles , radiusExtent ) {
0 commit comments