From dfc37ff1a77894996241fd2c03bf15b3053c5ecd Mon Sep 17 00:00:00 2001 From: Abhinandan Kushwaha Date: Wed, 12 Jan 2022 19:20:31 +0530 Subject: [PATCH] Fixed issue with hideOrigin in Line charts --- package.json | 2 +- src/LineChart/index.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fd74edd..06d7e1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-gifted-charts", - "version": "0.2.6", + "version": "0.2.7", "description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.", "main": "src/index.tsx", "files": [ diff --git a/src/LineChart/index.tsx b/src/LineChart/index.tsx index 12fc10e..187a620 100644 --- a/src/LineChart/index.tsx +++ b/src/LineChart/index.tsx @@ -1061,16 +1061,22 @@ export const LineChart = (props: propTypes) => { marginBottom: stepHeight / -2, }, ]}> - {showFractionalValues + {hideOrigin + ? index === horizSections.length - 1 + ? '' + : showFractionalValues + ? sectionItems.value + ? sectionItems.value + : '0' + : sectionItems.value + ? sectionItems.value.toString().split('.')[0] + : '0' + : showFractionalValues ? sectionItems.value ? sectionItems.value - : hideOrigin - ? '' : '0' : sectionItems.value ? sectionItems.value.toString().split('.')[0] - : hideOrigin - ? '' : '0'} ) : null}