From 6c0bd2e75afe67d0423386247049257a0a0edda1 Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Thu, 24 Aug 2023 10:39:39 -0300 Subject: [PATCH] fix: only render y axis labels if they are not empty --- src/LineChart/renderHorizSections.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LineChart/renderHorizSections.tsx b/src/LineChart/renderHorizSections.tsx index 24d9536..ac31810 100644 --- a/src/LineChart/renderHorizSections.tsx +++ b/src/LineChart/renderHorizSections.tsx @@ -178,7 +178,7 @@ export const renderHorizSections = props => { if (hideOrigin && index === horizSections.length - 1) { label = ''; } - return ( + return label.length > 0 ? ( { {label} - ); + ) : null; }) /***********************************************************************************************/ /***********************************************************************************************/ @@ -289,7 +289,7 @@ export const renderHorizSections = props => { horizSectionsBelow[horizSectionsBelow.length - 1 - index].value, index, ); - return ( + return label.length > 0 ? ( { {label} - ); + ) : null; }) /***********************************************************************************************/ /***********************************************************************************************/