Skip to content

Instantly share code, notes, and snippets.

@LintangWisesa
Created October 11, 2019 09:27
Show Gist options
  • Save LintangWisesa/48cedce6210e18050f415d0e36087868 to your computer and use it in GitHub Desktop.
Save LintangWisesa/48cedce6210e18050f415d0e36087868 to your computer and use it in GitHub Desktop.
React Native Chart Kit - #2 Bezier Line Chart
<LineChart
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: "#e26a00",
backgroundGradientFrom: "#fb8c00",
backgroundGradientTo: "#ffa726",
decimalPlaces: 2, // optional, defaults to 2dp
color: (opacity = 1) => `white`,
labelColor: (opacity = 1) => `white`,
style: {
borderRadius: 16
}
}}
bezier
style={{
marginVertical: 8,
borderRadius: 16
}}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment