Merge pull request #3 from Abhinandan-Kushwaha/development

Development
This commit is contained in:
Abhinandan Kushwaha 2021-08-05 17:44:12 +05:30 committed by GitHub
commit f724c920d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 138 additions and 128 deletions

18
App.js
View File

@ -19,28 +19,30 @@ const App = () => {
// ]; // ];
const data = [ const data = [
{value: 150}, {value: 15, label: 'Jan'},
{value: 80, text: 80}, {value: 40, label: 'Feb'},
{value: 90, text: 90, textColor: 'green', textBackgroundColor: 'pink'}, {value: 10, label: 'Mar'},
{value: 70}, {value: 0, label: 'Apr'},
]; ];
return ( return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<BarChart <BarChart
showGradient showGradient
isThreeD
isAnimated
gradientColor="gray" gradientColor="gray"
frontColor="white" // frontColor="white"
data={data} data={data}
/> />
<LineChart data={data} /> {/* <LineChart data={data} /> */}
<PieChart {/* <PieChart
showText showText
showTextBackground showTextBackground
showValuesAsLabels showValuesAsLabels
textSize={14} textSize={14}
data={data} data={data}
/> /> */}
{/* <LineChart data={data} curved /> */} {/* <LineChart data={data} curved /> */}
{/* <BarChart {/* <BarChart
data={data} data={data}

View File

@ -1,6 +1,6 @@
{ {
"name": "react-native-gifted-charts", "name": "react-native-gifted-charts",
"version": "0.0.6", "version": "0.0.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.", "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", "main": "src/index.tsx",
"files": [ "files": [

View File

@ -118,6 +118,7 @@ const AnimatedBar = (props: animatedBarPropTypes) => {
{opacity: opacity, position: 'absolute', bottom: 0}, {opacity: opacity, position: 'absolute', bottom: 0},
props.side === 'right' && {transform: [{rotateY: '180deg'}]}, props.side === 'right' && {transform: [{rotateY: '180deg'}]},
]}> ]}>
{props.height ? (
<View style={{marginTop: width / -2}}> <View style={{marginTop: width / -2}}>
<TriangleCorner <TriangleCorner
color={sideColor} color={sideColor}
@ -138,9 +139,11 @@ const AnimatedBar = (props: animatedBarPropTypes) => {
style={{transform: [{rotate: '90deg'}], opacity: opacity}} style={{transform: [{rotate: '90deg'}], opacity: opacity}}
/> />
</View> </View>
) : null}
{/******************* Top View *****************/} {/******************* Top View *****************/}
{props.height ? (
<>
<View style={{position: 'absolute', top: width / -2}}> <View style={{position: 'absolute', top: width / -2}}>
<TriangleCorner <TriangleCorner
color={topColor} color={topColor}
@ -159,13 +162,16 @@ const AnimatedBar = (props: animatedBarPropTypes) => {
}} }}
/> />
</View> </View>
<View style={{position: 'absolute', top: width / -2, left: width}}> <View
style={{position: 'absolute', top: width / -2, left: width}}>
<TriangleCorner <TriangleCorner
color={topColor} color={topColor}
width={width} width={width}
style={{transform: [{rotate: '-90deg'}], opacity: opacity}} style={{transform: [{rotate: '-90deg'}], opacity: opacity}}
/> />
</View> </View>
</>
) : null}
{/*******************************************************************/} {/*******************************************************************/}

View File

@ -71,6 +71,7 @@ const ThreeDBar = (props: PropTypes) => {
const opacity = props.opacity || 1; const opacity = props.opacity || 1;
return ( return (
<View style={styles.container}> <View style={styles.container}>
{props.height ? (
<View <View
style={[ style={[
styles.row, styles.row,
@ -147,6 +148,7 @@ const ThreeDBar = (props: PropTypes) => {
)} )}
</View> </View>
</View> </View>
) : null}
{/******************* Top Label *****************/} {/******************* Top Label *****************/}