-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathwith-shadow.js
36 lines (29 loc) · 888 Bytes
/
with-shadow.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
import React from 'react'
import { LineChart, Path, Grid } from 'react-native-svg-charts'
class LineChartExample extends React.PureComponent {
render() {
const data = [ 50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80 ]
const Shadow = ({ line }) => (
<Path
key={'shadow'}
y={2}
d={line}
fill={'none'}
strokeWidth={4}
stroke={'rgba(134, 65, 244, 0.2)'}
/>
)
return (
<LineChart
style={ { height: 200 } }
data={ data }
svg={{ stroke: 'rgb(134, 65, 244)' }}
contentInset={ { top: 20, bottom: 20 } }
>
<Grid/>
<Shadow/>
</LineChart>
)
}
}
export default LineChartExample