@@ -53,7 +53,9 @@ export function getSeriesBreakConfig(axesSpec: ILinearAxisSpec[], axesIndex?: nu
53
53
const parsedAxisId = axisId ?? `${ axisModel . type } -${ axisModel . id } ` ;
54
54
55
55
const regionBounds = getAllRegionBounds ( axisModel . getRegions ( ) ) ;
56
- array ( spec . breaks ) . forEach ( ( breakConfig : ILinearAxisBreakSpec ) => {
56
+
57
+ // todo 这里用到了内部变量,不太安全
58
+ array ( axisModel . _break ?. breaks ) . forEach ( ( breakConfig : ILinearAxisBreakSpec ) => {
57
59
const { range, breakSymbol, gap = 5 } = breakConfig ;
58
60
const pos1 = axisModel . valueToPosition ( range [ 0 ] ) ;
59
61
const pos2 = axisModel . valueToPosition ( range [ 1 ] ) ;
@@ -356,7 +358,7 @@ function isPointInPolygon(point: Point, polygon: Point[]) {
356
358
357
359
export const appendSeriesBreakConfig = ( rawSpec : ISpec ) => {
358
360
if ( rawSpec . axes ?. length ) {
359
- const breakedAxes = rawSpec . axes . filter ( ( axis : any ) => axis . breaks && axis . breaks . length ) ;
361
+ const breakedAxes = rawSpec . axes . filter ( ( axis : any ) => axis . breaks && axis . breaks . length && axis . visible !== false ) ;
360
362
361
363
if ( breakedAxes . length ) {
362
364
( rawSpec as any ) . customMark = array ( ( rawSpec as any ) . customMark ) . filter (
@@ -366,7 +368,7 @@ export const appendSeriesBreakConfig = (rawSpec: ISpec) => {
366
368
getSeriesBreakConfig (
367
369
breakedAxes as ILinearAxisSpec [ ] ,
368
370
breakedAxes . map ( axisSpec => {
369
- return rawSpec . axes . indexOf ( axisSpec ) ;
371
+ return rawSpec . axes . indexOf ( axisSpec as any ) ;
370
372
} )
371
373
)
372
374
) ;
0 commit comments