From fa96d1238725997294f3e5dc64b3ac9c9c9be225 Mon Sep 17 00:00:00 2001 From: Fei Date: Tue, 21 Jul 2020 11:32:47 -0400 Subject: [PATCH 1/2] fix: remove space on edge on custom domain --- packages/core/src/components/axes/axis.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/core/src/components/axes/axis.ts b/packages/core/src/components/axes/axis.ts index c810af5994..641504b917 100644 --- a/packages/core/src/components/axes/axis.ts +++ b/packages/core/src/components/axes/axis.ts @@ -201,9 +201,16 @@ export class Axis extends Component { "timeScale", "addSpaceOnEdges" ); + + const customDomain = Tools.getProperty( + options, + "axes", + axisPosition, + "domain" + ); let tickValues; - if (addSpaceOnEdges) { + if (addSpaceOnEdges && !customDomain) { tickValues = scale.nice(numberOfTicks); } tickValues = scale.ticks(numberOfTicks); From 9ad904600b2e7a050e057eb0c000e99e5a2cc82c Mon Sep 17 00:00:00 2001 From: Fei Date: Tue, 21 Jul 2020 11:50:56 -0400 Subject: [PATCH 2/2] fix: keep labels on the edges for custom domain --- packages/core/src/components/axes/axis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/components/axes/axis.ts b/packages/core/src/components/axes/axis.ts index 641504b917..6ac0eda88a 100644 --- a/packages/core/src/components/axes/axis.ts +++ b/packages/core/src/components/axes/axis.ts @@ -217,7 +217,7 @@ export class Axis extends Component { // Remove labels on the edges // If there are more than 2 labels to show - if (addSpaceOnEdges && tickValues.length > 2) { + if (addSpaceOnEdges && tickValues.length > 2 && !customDomain) { tickValues.splice(tickValues.length - 1, 1); tickValues.splice(0, 1); }