Created
March 13, 2016 17:48
-
-
Save Jpadilla1/abbc1e4378e5f6fd7eca to your computer and use it in GitHub Desktop.
react-native-ios-charts ScatterChart example
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
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
View | |
} from 'react-native'; | |
import { ScatterChart } from 'react-native-ios-charts'; | |
class charts extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<ScatterChart | |
config={{ | |
dataSets: [{ | |
values: [10, 20, 5, 8, 15, 30], | |
colors: ['green'], | |
label: '2015' | |
}], | |
labels: ['a', 'b', 'c', 'd'] | |
}} | |
style={styles.chart} | |
/> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF' | |
}, | |
chart: { | |
width: 350, | |
height: 500 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment