Created
October 11, 2019 09:28
-
-
Save LintangWisesa/87c1764bdeeed346f4125b53b6ebeb68 to your computer and use it in GitHub Desktop.
React Native Chart Kit - #3 Bar Chart
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
<BarChart | |
data={{ | |
labels: ["Januari", "Februari", "Maret", "April", "Mei", "Juni"], | |
datasets: [ | |
{ | |
data: [ | |
Math.random() * 100, | |
Math.random() * 100, | |
Math.random() * 100, | |
Math.random() * 100, | |
Math.random() * 100, | |
Math.random() * 100 | |
] | |
} | |
] | |
}} | |
width={Dimensions.get("window").width - 50} // from react-native | |
height={220} | |
yAxisLabel={"Rp"} | |
chartConfig={{ | |
backgroundColor: "yellow", | |
backgroundGradientFrom: "yellow", | |
backgroundGradientTo: "yellow", | |
decimalPlaces: 2, // optional, defaults to 2dp | |
color: (opacity = 1) => `black`, | |
labelColor: (opacity = 1) => `black`, | |
barPercentage:1, | |
style: { | |
borderRadius: 16 | |
} | |
}} | |
style={{ | |
marginVertical: 8, | |
borderRadius: 16 | |
}} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment