Created
April 18, 2020 00:21
-
-
Save marshallmurphy/03554abeade8f1f22fff2e5f4c831572 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BarGraph/index.js | |
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions } from 'react-native'; | |
import Columns from './Columns'; | |
import XAxis from './xAxis'; | |
import YAxis from './yAxis'; | |
export default function BarGraph({ data, color }) { | |
let width = Dimensions.get('screen').width; | |
let yAxisHeight = 325; | |
let xAxisHeight = 30; | |
let barsHeight = 315; | |
return ( | |
<View style={styles.main}> | |
<YAxis | |
height={yAxisHeight} | |
width={width} /> | |
<Columns | |
data={data} | |
width={width - 10} | |
height={barsHeight} | |
color={color} /> | |
<XAxis | |
width={width - 10} | |
height={xAxisHeight} /> | |
</View> | |
); | |
} | |
const styles = StyleSheet.create({ | |
main: { | |
marginVertical: 25, | |
marginHorizontal: 0, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment