From 162b533b6dc27b742c21ec3a2ed3492ba4586c04 Mon Sep 17 00:00:00 2001 From: Abhinandan Kushwaha Date: Thu, 5 Aug 2021 17:42:48 +0530 Subject: [PATCH] Handled 0 values --- App.js | 18 ++-- package.json | 2 +- src/Components/AnimatedBar/index.tsx | 98 +++++++++--------- src/Components/ThreeDBar/index.tsx | 148 ++++++++++++++------------- 4 files changed, 138 insertions(+), 128 deletions(-) diff --git a/App.js b/App.js index 15388cb..c24c25d 100644 --- a/App.js +++ b/App.js @@ -19,28 +19,30 @@ const App = () => { // ]; const data = [ - {value: 150}, - {value: 80, text: 80}, - {value: 90, text: 90, textColor: 'green', textBackgroundColor: 'pink'}, - {value: 70}, + {value: 15, label: 'Jan'}, + {value: 40, label: 'Feb'}, + {value: 10, label: 'Mar'}, + {value: 0, label: 'Apr'}, ]; return ( - - */} + {/* + /> */} {/* */} {/* { {opacity: opacity, position: 'absolute', bottom: 0}, props.side === 'right' && {transform: [{rotateY: '180deg'}]}, ]}> - - - - - + {props.height ? ( + + + + + + ) : null} {/******************* Top View *****************/} - - - - - - - - - - + {props.height ? ( + <> + + + + + + + + + + + ) : null} {/*******************************************************************/} diff --git a/src/Components/ThreeDBar/index.tsx b/src/Components/ThreeDBar/index.tsx index 205f6b3..e56e88c 100644 --- a/src/Components/ThreeDBar/index.tsx +++ b/src/Components/ThreeDBar/index.tsx @@ -71,82 +71,84 @@ const ThreeDBar = (props: PropTypes) => { const opacity = props.opacity || 1; return ( - - - - - - - - {/******************* Top View *****************/} - - - - - - - - - - - - {/*******************************************************************/} - + {props.height ? ( - {showGradient && ( - + + - )} + + + + + {/******************* Top View *****************/} + + + + + + + + + + + + {/*******************************************************************/} + + + {showGradient && ( + + )} + - + ) : null} {/******************* Top Label *****************/}