diff --git a/packages/vrender-components/src/crosshair/polygon-sector.ts b/packages/vrender-components/src/crosshair/polygon-sector.ts index fbefdacc5..5aad7e924 100644 --- a/packages/vrender-components/src/crosshair/polygon-sector.ts +++ b/packages/vrender-components/src/crosshair/polygon-sector.ts @@ -9,6 +9,7 @@ import { CrosshairBase } from './base'; import type { PolygonSectorCrosshairAttrs } from './type'; import type { ComponentOptions } from '../interface'; import { loadPolygonSectorCrosshairComponent } from './register'; +import { getPolygonPath } from '../axis'; loadPolygonSectorCrosshairComponent(); export class PolygonSectorCrosshair extends CrosshairBase { @@ -32,17 +33,11 @@ export class PolygonSectorCrosshair extends CrosshairBase { - if (index === 0) { - return `M${cur.x},${cur.y}`; - } - return acc + `L${cur.x},${cur.y}`; - }, ''); const polygon = container.createOrUpdateChild( 'crosshair-polygon-sector', { - path, + path: getPolygonPath(points, true), ...polygonSectorStyle }, 'path'