-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChartKit1.js
49 lines (47 loc) · 1.39 KB
/
ChartKit1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react';
import {View, Text, Dimensions, SafeAreaView} from 'react-native';
import {LineChart} from 'react-native-chart-kit';
const ChartKit1 = () => {
return (
<SafeAreaView style={{flex: 1}}>
<View style={{justifyContent: 'center', alignItems: 'center'}}>
<LineChart
data={{
labels: ['January', 'February', 'March', 'April'],
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 - 16} // from react-native
height={220}
yAxisLabel={'Rs'}
chartConfig={{
backgroundColor: 'pink',
backgroundGradientFrom: 'white',
backgroundGradientTo: 'white',
decimalPlaces: 2, // optional, defaults to 2dp
color: (opacity = 255) => `rgba(0, 0, 0, ${opacity})`,
style: {
borderRadius: 16,
},
}}
bezier
style={{
marginVertical: 0,
borderRadius: 0,
}}
/>
</View>
</SafeAreaView>
);
};
export default ChartKit1;