diff --git a/packages/charts/src/coordinates/EdgeCoordinateV3.tsx b/packages/charts/src/coordinates/EdgeCoordinateV3.tsx index 05cdf576f..0dff4c1a6 100644 --- a/packages/charts/src/coordinates/EdgeCoordinateV3.tsx +++ b/packages/charts/src/coordinates/EdgeCoordinateV3.tsx @@ -266,7 +266,7 @@ export function drawOnCanvas(ctx: CanvasRenderingContext2D, props) { } else if (rectRadius) { roundRect(ctx, x, y, rectWidth, rectHeight, 3); } else { - ctx.rect(x + 0.5, y + 0.5, rectWidth, rectHeight); + ctx.rect(x - 0.5, y - 0.5, rectWidth, rectHeight); } ctx.fill(); diff --git a/packages/charts/src/coordinates/MouseCoordinateY.tsx b/packages/charts/src/coordinates/MouseCoordinateY.tsx index c94fc5a6b..6be247b90 100644 --- a/packages/charts/src/coordinates/MouseCoordinateY.tsx +++ b/packages/charts/src/coordinates/MouseCoordinateY.tsx @@ -56,14 +56,18 @@ export class MouseCoordinateY extends React.Component { private readonly renderSVG = (moreProps) => { const props = this.helper(this.props, moreProps); - if (isNotDefined(props)) { return null; } + if (isNotDefined(props)) { + return null; + } return renderSVG(props); } private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps) => { const props = this.helper(this.props, moreProps); - if (isNotDefined(props)) { return null; } + if (isNotDefined(props)) { + return null; + } drawOnCanvas(ctx, props); } @@ -72,11 +76,17 @@ export class MouseCoordinateY extends React.Component { const { chartId } = moreProps; const { currentCharts, mouseXY } = moreProps; - if (isNotDefined(mouseXY)) { return null; } - if (currentCharts.indexOf(chartId) < 0) { return null; } + if (isNotDefined(mouseXY)) { + return null; + } + if (currentCharts.indexOf(chartId) < 0) { + return null; + } const { show } = moreProps; - if (!show) { return null; } + if (!show) { + return null; + } const y = mouseXY[1]; const { chartConfig: { yScale } } = moreProps; @@ -113,18 +123,14 @@ export function getYCoordinate(y, displayValue, props, moreProps) { hideLine, fill, opacity, - fontFamily, fontSize, textFill, - stroke, strokeOpacity, strokeWidth, - rectWidth, rectHeight, - arrowWidth, dx, x1, @@ -132,5 +138,6 @@ export function getYCoordinate(y, displayValue, props, moreProps) { y1: y, y2: y, }; + return coordinateProps; }