@@ -70,6 +70,7 @@ import { error, log } from '../../util/log';
7070import { AxisTickLabelComputingKind } from '../axisTickLabelBuilder' ;
7171import { injectCoordSysByOption } from '../../core/CoordinateSystem' ;
7272import { mathMax , parsePositionSizeOption } from '../../util/number' ;
73+ import { MarkerTypes } from '../../component/marker/checkMarkerInSeries' ;
7374
7475type Cartesian2DDimensionName = 'x' | 'y' ;
7576
@@ -81,8 +82,6 @@ type AxesMap = {
8182
8283type ParsedOuterBoundsContain = 'all' | 'axisLabel' ;
8384
84- type MarkerTypes = 'markPoint' | 'markLine' | 'markArea' ;
85-
8685// margin is [top, right, bottom, left]
8786const XY_TO_MARGIN_IDX = [
8887 [ 3 , 1 ] , // xyIdx 0 => 'x'
@@ -545,7 +544,7 @@ class Grid implements CoordinateSystemMaster {
545544 unionExtent ( data , xAxis ) ;
546545 unionExtent ( data , yAxis ) ;
547546
548- // 处理 markPoint、 markLine、 markArea
547+ // Handle markPoint, markLine, markArea
549548 const markerTypes : MarkerTypes [ ] = [ 'markPoint' , 'markLine' , 'markArea' ] ;
550549
551550 markerTypes . forEach ( markerType => {
@@ -563,7 +562,7 @@ class Grid implements CoordinateSystemMaster {
563562 } ) ;
564563 }
565564
566- function UnionExtentForAxisByValue (
565+ function unionExtentForAxisByValue (
567566 value : any ,
568567 axis : Axis2D ,
569568 axisType : OptionAxisType ,
@@ -572,10 +571,7 @@ class Grid implements CoordinateSystemMaster {
572571 if ( includeMarkerInExtent && value != null && typeof value !== 'string' && axisType !== 'category' ) {
573572 const val = axis . scale . parse ( value ) ;
574573 if ( ! isNaN ( val ) ) {
575- // Construct the parameter and use unionExtentFromData to avoid using the private method _innerUnionExtent
576- axis . scale . unionExtentFromData ( {
577- getApproximateExtent : ( ) => [ val , val ]
578- } as any , 0 ) ;
574+ axis . scale . unionExtentByValue ( val ) ;
579575 }
580576 }
581577 }
@@ -596,12 +592,12 @@ class Grid implements CoordinateSystemMaster {
596592 return ;
597593 }
598594
599- UnionExtentForAxisByValue ( markerItem . xAxis , xAxis , xAxis . type ) ;
600- UnionExtentForAxisByValue ( markerItem . yAxis , yAxis , yAxis . type ) ;
595+ unionExtentForAxisByValue ( markerItem . xAxis , xAxis , xAxis . type ) ;
596+ unionExtentForAxisByValue ( markerItem . yAxis , yAxis , yAxis . type ) ;
601597
602598 if ( markerItem . coord && Array . isArray ( markerItem . coord ) ) {
603- UnionExtentForAxisByValue ( markerItem . coord [ 0 ] , xAxis , xAxis . type ) ;
604- UnionExtentForAxisByValue ( markerItem . coord [ 1 ] , yAxis , yAxis . type ) ;
599+ unionExtentForAxisByValue ( markerItem . coord [ 0 ] , xAxis , xAxis . type ) ;
600+ unionExtentForAxisByValue ( markerItem . coord [ 1 ] , yAxis , yAxis . type ) ;
605601 }
606602 } ) ;
607603 } ) ;
0 commit comments