Created
October 11, 2019 09:29
-
-
Save LintangWisesa/1d7b004deae1811ce14c2b5feeffafad to your computer and use it in GitHub Desktop.
React Native Chart Kit - #4 Stacked 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
<StackedBarChart | |
data={{ | |
labels: ["Test1", "Test2"], | |
legend: ["L1", "L2", "L3"], | |
data: [[60, 60, 60], [30, 30, 60]], | |
barColors: ["#dfe4ea", "#ced6e0", "#a4b0be"] | |
}} | |
width={Dimensions.get("window").width - 50} // from react-native | |
height={220} | |
yAxisLabel={"Rp"} | |
chartConfig={{ | |
backgroundColor: "green", | |
backgroundGradientFrom: "green", | |
backgroundGradientTo: "green", | |
decimalPlaces: 2, // optional, defaults to 2dp | |
color: (opacity = 1) => `white`, | |
labelColor: (opacity = 1) => `white`, | |
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